From patchwork Tue Mar 26 18:07:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13604827 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 1E1C4CD11DF for ; Tue, 26 Mar 2024 18:12:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=cbdrM97V+NMCu3LkQh7XSYuvRYPDy5lnLWOuL1LBKag=; b=n4nE1nHWWv9NRW RSXC1hVYP/Eq6FYlOvu7y7qWdmIDOR78Cb+gkch3YeYlFG6EwW6fdhNpvl9aoDM4RvSmNMSRzt79z bn5lWsDMxWZekdzzzmPT3h8A1yadOeWg4H6+ydP/UUe3CVNyJ8K6cbyXm0pJ4sN/kYXlpbdAkyB1h owjYi7BbQEJhj14NIUVkta9j+HGMut6sdZ11aZJiHR/D6u3K8jExpSZ4dCCWOxXCdPFpqisvxpRVk 0MTRv2GW7UTcPPIldu3wrs87pH7RJoikjAuziG0lVRol6wzjOtVYIPEoHnEGIgWXCCiMDPbfWr9iZ SUoWRnpXX3qRAQ+3wsYQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rpBH0-00000005sxR-477H; Tue, 26 Mar 2024 18:11:46 +0000 Received: from mgamail.intel.com ([192.198.163.12]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rpBG1-00000005sPZ-2uqX for linux-arm-kernel@lists.infradead.org; Tue, 26 Mar 2024 18:10:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1711476645; x=1743012645; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=OHu0e1fzfnbbh01dHJSe36zf7TwpFULLxcAa0gHl81c=; b=jhvhahIxEK1OGq+mUXg9UP1u3r/bNBau8hcOKfsZl5kjMmTLFA6g+VXe Sj545A/6zOR2mwslrnf/uXR9IVkwPhnk99H5A06JIzJsALKpmHl+/KOZv 2tnVfOMEnlboHE+96qVrypzbc/xARri+62RnYW2Yp2eRs1IfabD5ftEp+ dG0sv7TVrAmqGgE4Do3ajNKDjBaQBkRocJtIFn/3FIlszopFGEWeuhtvr rnWcZdaTU1BBKq1j/mQ8FPou4LGlHrzV+yRuYjKyu2GDbdbdAYU35I1d4 UZ7NKkLHoNVIWEDlYTAJjMkoOMYbfFi9xCJC4Dykpbkcxkc+gQniaOiNi Q==; X-CSE-ConnectionGUID: HvxvHGKOQxWuolqtFSHcuQ== X-CSE-MsgGUID: vvVauzP3Sqiu29DIP+YrZA== X-IronPort-AV: E=McAfee;i="6600,9927,11025"; a="10325706" X-IronPort-AV: E=Sophos;i="6.07,156,1708416000"; d="scan'208";a="10325706" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmvoesa106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Mar 2024 11:10:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,11025"; a="937072942" X-IronPort-AV: E=Sophos;i="6.07,156,1708416000"; d="scan'208";a="937072942" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 26 Mar 2024 11:10:38 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 2A608E2E; Tue, 26 Mar 2024 20:10:35 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Mark Brown , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Daniel Mack , Haojian Zhuang , Robert Jarzmik , Russell King Subject: [PATCH v1 07/10] spi: pxa2xx: Provide num-cs for Sharp PDAs via device properties Date: Tue, 26 Mar 2024 20:07:57 +0200 Message-ID: <20240326181027.1418989-8-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20240326181027.1418989-1-andriy.shevchenko@linux.intel.com> References: <20240326181027.1418989-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240326_111045_847876_65971F3A X-CRM114-Status: GOOD ( 16.96 ) 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 Since driver can parse num-cs device property, replace platform data with this new approach. Signed-off-by: Andy Shevchenko --- arch/arm/mach-pxa/spitz.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c index 318402ad685e..3c5f5a3cb480 100644 --- a/arch/arm/mach-pxa/spitz.c +++ b/arch/arm/mach-pxa/spitz.c @@ -18,10 +18,10 @@ #include #include #include +#include #include #include #include -#include #include #include #include @@ -569,10 +569,6 @@ static struct spi_board_info spitz_spi_devices[] = { }, }; -static struct pxa2xx_spi_controller spitz_spi_info = { - .num_chipselect = 3, -}; - static struct gpiod_lookup_table spitz_spi_gpio_table = { .dev_id = "spi2", .table = { @@ -583,10 +579,20 @@ static struct gpiod_lookup_table spitz_spi_gpio_table = { }, }; +static const struct property_entry spitz_spi_properties[] = { + PROPERTY_ENTRY_U32("num-cs", 3), + { } +}; + +static const struct software_node spitz_spi_node = { + .properties = spitz_spi_properties, +}; + static void __init spitz_spi_init(void) { struct platform_device *pd; int id = 2; + int err; if (machine_is_akita()) gpiod_add_lookup_table(&akita_lcdcon_gpio_table); @@ -601,8 +607,13 @@ static void __init spitz_spi_init(void) if (pd == NULL) { pr_err("pxa2xx-spi: failed to allocate device id %d\n", id); } else { - pd->dev.platform_data = &spitz_spi_info; - platform_device_add(pd); + err = device_add_software_node(&pd->dev, &spitz_spi_node); + if (err) { + platform_device_put(pd); + pr_err("pxa2xx-spi: failed to add software node\n"); + } else { + platform_device_add(pd); + } } spi_register_board_info(ARRAY_AND_SIZE(spitz_spi_devices));