diff mbox series

[v1,1/3] ARM: pxa/lubbock: Replace custom ->cs_control() by GPIO lookup table

Message ID 20211123192723.44537-1-andriy.shevchenko@linux.intel.com (mailing list archive)
State Accepted
Commit 342e3ce0f6f4691b31b1c7c9c3ae37160c4a82d2
Headers show
Series [v1,1/3] ARM: pxa/lubbock: Replace custom ->cs_control() by GPIO lookup table | expand

Commit Message

Andy Shevchenko Nov. 23, 2021, 7:27 p.m. UTC
SPI PXA2xx driver supports GPIO chipselect by querying for known
GPIO connection ID. Replace custom ->cs_control() by GPIO table,
so the driver will use generic approach on this platform.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 arch/arm/mach-pxa/lubbock.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

Comments

Mark Brown Nov. 29, 2021, 4:45 p.m. UTC | #1
On Tue, 23 Nov 2021 21:27:21 +0200, Andy Shevchenko wrote:
> SPI PXA2xx driver supports GPIO chipselect by querying for known
> GPIO connection ID. Replace custom ->cs_control() by GPIO table,
> so the driver will use generic approach on this platform.
> 
> 

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/3] ARM: pxa/lubbock: Replace custom ->cs_control() by GPIO lookup table
      commit: 342e3ce0f6f4691b31b1c7c9c3ae37160c4a82d2
[2/3] spi: pxa2xx: Get rid of unused ->cs_control()
      commit: a9c8f68ce2c37ced2f7a8667eda71b7753ede398
[3/3] spi: pxa2xx: Get rid of unused enable_loopback member
      commit: 8393961c53b31078cfc877bc00eb0f67e1474edd

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark
diff mbox series

Patch

diff --git a/arch/arm/mach-pxa/lubbock.c b/arch/arm/mach-pxa/lubbock.c
index 742d18a1f7dc..e2411971422d 100644
--- a/arch/arm/mach-pxa/lubbock.c
+++ b/arch/arm/mach-pxa/lubbock.c
@@ -211,16 +211,17 @@  static struct ads7846_platform_data ads_info = {
 	// .y_plate_ohms		= 500,	/* GUESS! */
 };
 
-static void ads7846_cs(u32 command)
-{
-	static const unsigned	TS_nCS = 1 << 11;
-	lubbock_set_misc_wr(TS_nCS, (command == PXA2XX_CS_ASSERT) ? 0 : TS_nCS);
-}
+static struct gpiod_lookup_table ads7846_cs_gpios = {
+	.dev_id		= "ads7846",
+	.table		= {
+		GPIO_LOOKUP("lubbock", 11, "cs", GPIO_ACTIVE_LOW),
+		{}
+	},
+};
 
 static struct pxa2xx_spi_chip ads_hw = {
 	.tx_threshold		= 1,
 	.rx_threshold		= 2,
-	.cs_control		= ads7846_cs,
 };
 
 static struct spi_board_info spi_board_info[] __initdata = { {
@@ -512,6 +513,8 @@  static void __init lubbock_init(void)
 	lubbock_flash_data[flashboot].name = "boot-rom";
 	(void) platform_add_devices(devices, ARRAY_SIZE(devices));
 
+	gpiod_add_lookup_table(&ads7846_cs_gpios);
+
 	pxa2xx_set_spi_info(1, &pxa_ssp_master_info);
 	spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
 }