From patchwork Thu Mar 7 19:47:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 779121 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A9BAB1386C8; Thu, 7 Mar 2024 19:51:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.21 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709841066; cv=none; b=XCEI7xMiIm/U1lbZG6DoDwfravTZ7IIAcFiK3oFyPTNEhK92KyyMAM66qj/tP65yrth9+z42XMfwVF8mfcY9n4LF37uFnDNdtp/ESs3tlklyvcn+b7c9jU9/w7zkJpQ+GqM1A5pdKHeKuT4JD37law8w5rGtZ+WEo/Msr6QJeeo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709841066; c=relaxed/simple; bh=segAw9fxy9OyPIlfkjenwM6Zuv9t3GwWq2yppvlcvw8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ez3vTLqIEOtRubgwJ8Ru37W8gT+0XSE1c9zb7mHrZp1H+RWZgZUDWLS4U/3MAggbT51JC2YJMGnWWcgY2qVa1eRxdjzQf4A/TtQVKcZcmpt5xCaTLZD6CMq2ueftyFK6loMlMq3NMGXErQwEL5ORfJbyXLeXjV0v2YwcNdFLv8g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=WOQIRklS; arc=none smtp.client-ip=198.175.65.21 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="WOQIRklS" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1709841064; x=1741377064; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=segAw9fxy9OyPIlfkjenwM6Zuv9t3GwWq2yppvlcvw8=; b=WOQIRklSPIby8s0niiWNmOLINva2uPDWhm+/3RuMFMLMSwjAzjr9iv+D jckOh5xFM1K6o8Pu/YqRJ4RSre/mCbqbdi7Ky0gEVI0ANnu/Wj9n50U/z BNNuPmwXoALRL9mMTT9IDYS/7TpZQDv70qPrMp8MqnAD/xhRRQErSM01u +C2k4biwU5CXvjXkp1ljxbeWYW2E6+a2M48F2FFLO70dVP3qrpnfg9p/4 /WNkxL6GD9sVkWe5hCkKprpULuSgg/YBzJUdP0RgeZcUtXFlJCQUnA+1j SQIOhSQv5Kxc6tvs+PnZhgYXvlDp/yDg0pZ+IHcYSim0CmUqV3Qg6Laa0 g==; X-IronPort-AV: E=McAfee;i="6600,9927,11006"; a="4457050" X-IronPort-AV: E=Sophos;i="6.07,107,1708416000"; d="scan'208";a="4457050" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Mar 2024 11:51:01 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,11006"; a="937046516" X-IronPort-AV: E=Sophos;i="6.07,107,1708416000"; d="scan'208";a="937046516" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 07 Mar 2024 11:50:59 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 0C19493; Thu, 7 Mar 2024 21:50:57 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Arnd Bergmann , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Mark Brown , Daniel Mack , Haojian Zhuang , Robert Jarzmik , Russell King Subject: [PATCH v3 1/3] spi: pxa2xx: Kill pxa2xx_set_spi_info() Date: Thu, 7 Mar 2024 21:47:45 +0200 Message-ID: <20240307195056.4059864-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20240307195056.4059864-1-andriy.shevchenko@linux.intel.com> References: <20240307195056.4059864-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-spi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 There is the only one user of the pxa2xx_set_spi_info(). Unexport it and inline to the actual user. Signed-off-by: Andy Shevchenko Acked-by: Arnd Bergmann --- arch/arm/mach-pxa/devices.c | 18 ------------------ arch/arm/mach-pxa/spitz.c | 14 +++++++++++++- include/linux/spi/pxa2xx_spi.h | 8 -------- 3 files changed, 13 insertions(+), 27 deletions(-) diff --git a/arch/arm/mach-pxa/devices.c b/arch/arm/mach-pxa/devices.c index 661b3fc43275..1e4cd502340e 100644 --- a/arch/arm/mach-pxa/devices.c +++ b/arch/arm/mach-pxa/devices.c @@ -7,7 +7,6 @@ #include #include #include -#include #include #include @@ -665,23 +664,6 @@ struct platform_device pxa27x_device_gpio = { .resource = pxa_resource_gpio, }; -/* pxa2xx-spi platform-device ID equals respective SSP platform-device ID + 1. - * See comment in arch/arm/mach-pxa/ssp.c::ssp_probe() */ -void __init pxa2xx_set_spi_info(unsigned id, struct pxa2xx_spi_controller *info) -{ - struct platform_device *pd; - - pd = platform_device_alloc("pxa2xx-spi", id); - if (pd == NULL) { - printk(KERN_ERR "pxa2xx-spi: failed to allocate device id %d\n", - id); - return; - } - - pd->dev.platform_data = info; - platform_device_add(pd); -} - static struct resource pxa_dma_resource[] = { [0] = { .start = 0x40000000, diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c index cc691b199429..318402ad685e 100644 --- a/arch/arm/mach-pxa/spitz.c +++ b/arch/arm/mach-pxa/spitz.c @@ -585,6 +585,9 @@ static struct gpiod_lookup_table spitz_spi_gpio_table = { static void __init spitz_spi_init(void) { + struct platform_device *pd; + int id = 2; + if (machine_is_akita()) gpiod_add_lookup_table(&akita_lcdcon_gpio_table); else @@ -592,7 +595,16 @@ static void __init spitz_spi_init(void) gpiod_add_lookup_table(&spitz_ads7846_gpio_table); gpiod_add_lookup_table(&spitz_spi_gpio_table); - pxa2xx_set_spi_info(2, &spitz_spi_info); + + /* pxa2xx-spi platform-device ID equals respective SSP platform-device ID + 1 */ + pd = platform_device_alloc("pxa2xx-spi", id); + 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); + } + spi_register_board_info(ARRAY_AND_SIZE(spitz_spi_devices)); } #else diff --git a/include/linux/spi/pxa2xx_spi.h b/include/linux/spi/pxa2xx_spi.h index ca2cd4e30ead..56aba2f737b1 100644 --- a/include/linux/spi/pxa2xx_spi.h +++ b/include/linux/spi/pxa2xx_spi.h @@ -45,12 +45,4 @@ struct pxa2xx_spi_chip { u32 timeout; }; -#if defined(CONFIG_ARCH_PXA) || defined(CONFIG_ARCH_MMP) - -#include - -extern void pxa2xx_set_spi_info(unsigned id, struct pxa2xx_spi_controller *info); - -#endif - #endif /* __LINUX_SPI_PXA2XX_SPI_H */ From patchwork Thu Mar 7 19:47:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 778790 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 95CA4137C56; Thu, 7 Mar 2024 19:51:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.21 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709841064; cv=none; b=KXCR4uLyvGLiPGxLFS058PSgjNvKfx59foPGhFH/tSRH2aMRmK1i0dB5vSo+eJTWRddcG5T4wtcNCyNcgn278vsMXxLmS9kCSmzm/rBVTJaWB285xQmpqlmPIv9pplvC5MaZotCJ9Q7ucaz5fzemOE1NASfzr+MZ0ui2kIEI54E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709841064; c=relaxed/simple; bh=MvxOQpEMNaOWjzxyVQp/CL/dEEEmFaDsVhleVV905Oo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CPcLSr/dOA3kTTgc42mML4NrDSF5JcjfBvVQl2PDqvk+8zrBEya5/8ouKzIM1cIKkteehfY9jxA2h3YtSiPv1vIQKiI0K9i6ga3hO/i+QwErEWx/VSMc95NMGRQyklseoVnSn7m1BanjO/idy1Pf+SdbTeRj3t3wEtbvkMzHVpw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=B2mNFUWW; arc=none smtp.client-ip=198.175.65.21 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="B2mNFUWW" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1709841062; x=1741377062; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=MvxOQpEMNaOWjzxyVQp/CL/dEEEmFaDsVhleVV905Oo=; b=B2mNFUWW1o1fgvH8lIjkO6xfXvZIh/Y1//sk6L2HDhDAfOegprlFEVPc 7siGV7xUqOZqXZ1ufSAtSzPadAenedME+2XuA5+233RA5laeiBqW7lQ6j r4EgaxzUhh5NHRlp0CKZ3ESjNjRoCU84yHUKCyExD7Rq4YPoAQuMeh+c0 AH8+BaeZlFZtCGGja9EX2H8LCW53gb1udk2TlLWqIhva/boQf3dq6Fodg q10K6vFNmsPaLW1FIddjNOdJpT/Layc/efvsme0FVZAnfgzoLO/8WqHSu vokQ1yfaaoOqOsXFjkxCPmWudK2TK3eCeLzmWNhITGt6MkzGwhJBkjznK g==; X-IronPort-AV: E=McAfee;i="6600,9927,11006"; a="4457042" X-IronPort-AV: E=Sophos;i="6.07,107,1708416000"; d="scan'208";a="4457042" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Mar 2024 11:51:01 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,11006"; a="937046513" X-IronPort-AV: E=Sophos;i="6.07,107,1708416000"; d="scan'208";a="937046513" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 07 Mar 2024 11:50:59 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 164B3152; Thu, 7 Mar 2024 21:50:58 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Arnd Bergmann , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Mark Brown , Daniel Mack , Haojian Zhuang , Robert Jarzmik , Russell King Subject: [PATCH v3 2/3] spi: pxa2xx: Make num_chipselect 8-bit in the struct pxa2xx_spi_controller Date: Thu, 7 Mar 2024 21:47:46 +0200 Message-ID: <20240307195056.4059864-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20240307195056.4059864-1-andriy.shevchenko@linux.intel.com> References: <20240307195056.4059864-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-spi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 There is no use for whole 16-bit for the number of chip select pins. Drop it to 8 bits. Acked-by: Arnd Bergmann Signed-off-by: Andy Shevchenko --- Documentation/spi/pxa2xx.rst | 2 +- include/linux/spi/pxa2xx_spi.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/spi/pxa2xx.rst b/Documentation/spi/pxa2xx.rst index 19479b801826..0997d8eaf190 100644 --- a/Documentation/spi/pxa2xx.rst +++ b/Documentation/spi/pxa2xx.rst @@ -24,7 +24,7 @@ arch/.../mach-*/board-*.c as a "platform device". The host controller configurat is passed to the driver via a table found in include/linux/spi/pxa2xx_spi.h:: struct pxa2xx_spi_controller { - u16 num_chipselect; + u8 num_chipselect; u8 enable_dma; ... }; diff --git a/include/linux/spi/pxa2xx_spi.h b/include/linux/spi/pxa2xx_spi.h index 56aba2f737b1..e5a4a045fb67 100644 --- a/include/linux/spi/pxa2xx_spi.h +++ b/include/linux/spi/pxa2xx_spi.h @@ -17,7 +17,7 @@ struct dma_chan; * (resides in device.platform_data). */ struct pxa2xx_spi_controller { - u16 num_chipselect; + u8 num_chipselect; u8 enable_dma; u8 dma_burst_size; bool is_target; From patchwork Thu Mar 7 19:47:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 779120 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 572DB139587; Thu, 7 Mar 2024 19:51:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.21 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709841068; cv=none; b=im8va4Rp5v4IIYX6plS87GTV7HTInEq7Gvwm4OquhLOk4nVd41b2KVP6stHcsTNAYVodsMCIVAu+sbaRCTQ+G5sD49T9t+SMFNmNedHLXpzGtEIGsxsy938YCgbgekNc2gUZtPz1y/Ftb/bgkQjEalMFV5VkSbMixcKEqt2ZA98= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709841068; c=relaxed/simple; bh=k2iqYWkJ/g6zSAYNGIBSWfD8NyYp6rFQOmMuXPYLaRg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=q4/tk9O55Nlw/MrHXMWITo3s8L/Flk+e2g6ZoeIGBLbtu5vTiW1za+M/b+/iSpWv9S7QZAxdCwKNM78I0s/2jdRAGqCpgN6iABE62hmpqLqW6xBo4Y6sCU/VP0xpaHAbECmUEULKVKqkxBX0sGC96GHdRgLA+uB0O4VzfCNGtv0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=TnX7J8sl; arc=none smtp.client-ip=198.175.65.21 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="TnX7J8sl" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1709841066; x=1741377066; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=k2iqYWkJ/g6zSAYNGIBSWfD8NyYp6rFQOmMuXPYLaRg=; b=TnX7J8slgxK0ULboGSoY8V/WGxT4iKqDTq0MCwpWXSNQWqfpKj2isMIi Ywo6zJxkRabpvYoH7zhRf7qOnyedvqsNE/NNy3WF/f2l17jA8S1fFT+PO IcIY3lP8hzkHbG9j0rY4pOpykzFGRkoxwe2YZKLTVy+dEjXadNb5wrebg S8p+un4aUd/cSz0p40khXn2jDo2cRks/wiES63x2TG/6DTt9XQKe5Vwce UIZ8sGf1093qBApPdI0f7R1rT3zgRqMoIkQhcHBJua7so2BGovefnQeby tgsUHcdzlSZurwWY4Cy6V4ugZTV+WRVhevXzvClS6Jhla6H7V/CBYqCO4 g==; X-IronPort-AV: E=McAfee;i="6600,9927,11006"; a="4457058" X-IronPort-AV: E=Sophos;i="6.07,107,1708416000"; d="scan'208";a="4457058" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Mar 2024 11:51:01 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,11006"; a="937046514" X-IronPort-AV: E=Sophos;i="6.07,107,1708416000"; d="scan'208";a="937046514" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 07 Mar 2024 11:50:59 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 22889169; Thu, 7 Mar 2024 21:50:58 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Arnd Bergmann , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Mark Brown , Daniel Mack , Haojian Zhuang , Robert Jarzmik , Russell King Subject: [PATCH v3 3/3] spi: pxa2xx: Use proper SSP header in soc/pxa/ssp.c Date: Thu, 7 Mar 2024 21:47:47 +0200 Message-ID: <20240307195056.4059864-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20240307195056.4059864-1-andriy.shevchenko@linux.intel.com> References: <20240307195056.4059864-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-spi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 There is nothing from pxa2xx_spi.h used by soc/pxa/ssp.c. Replace it with pxa2xx_ssp.h. Signed-off-by: Andy Shevchenko Acked-by: Arnd Bergmann --- drivers/soc/pxa/ssp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soc/pxa/ssp.c b/drivers/soc/pxa/ssp.c index 7af04e8b8163..854d32e04558 100644 --- a/drivers/soc/pxa/ssp.c +++ b/drivers/soc/pxa/ssp.c @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include