hc
2024-05-10 37f49e37ab4cb5d0bc4c60eb5c6d4dd57db767bb
kernel/arch/arm/mach-ep93xx/simone.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * arch/arm/mach-ep93xx/simone.c
34 * Simplemachines Sim.One support.
....@@ -7,12 +8,6 @@
78 * Based on the 2.6.24.7 support:
89 * Copyright (C) 2009 Simplemachines
910 * MMC support by Peter Ivanov <ivanovp@gmail.com>, 2007
10
- *
11
- * This program is free software; you can redistribute it and/or modify
12
- * it under the terms of the GNU General Public License as published by
13
- * the Free Software Foundation; either version 2 of the License, or (at
14
- * your option) any later version.
15
- *
1611 */
1712
1813 #include <linux/kernel.h>
....@@ -25,9 +20,10 @@
2520 #include <linux/platform_data/video-ep93xx.h>
2621 #include <linux/platform_data/spi-ep93xx.h>
2722 #include <linux/gpio.h>
23
+#include <linux/gpio/machine.h>
2824
29
-#include <mach/hardware.h>
30
-#include <mach/gpio-ep93xx.h>
25
+#include "hardware.h"
26
+#include "gpio-ep93xx.h"
3127
3228 #include <asm/mach-types.h>
3329 #include <asm/mach/arch.h>
....@@ -45,9 +41,15 @@
4541 static struct mmc_spi_platform_data simone_mmc_spi_data = {
4642 .detect_delay = 500,
4743 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
48
- .flags = MMC_SPI_USE_CD_GPIO,
49
- .cd_gpio = EP93XX_GPIO_LINE_EGPIO0,
50
- .cd_debounce = 1,
44
+};
45
+
46
+static struct gpiod_lookup_table simone_mmc_spi_gpio_table = {
47
+ .dev_id = "mmc_spi.0", /* "mmc_spi" @ CS0 */
48
+ .table = {
49
+ /* Card detect */
50
+ GPIO_LOOKUP_IDX("A", 0, NULL, 0, GPIO_ACTIVE_LOW),
51
+ { },
52
+ },
5153 };
5254
5355 static struct spi_board_info simone_spi_devices[] __initdata = {
....@@ -70,13 +72,15 @@
7072 * low between multi-message command blocks. From v1.4, it uses a GPIO instead.
7173 * v1.3 parts will still work, since the signal on SFRMOUT is automatic.
7274 */
73
-static int simone_spi_chipselects[] __initdata = {
74
- EP93XX_GPIO_LINE_EGPIO1,
75
+static struct gpiod_lookup_table simone_spi_cs_gpio_table = {
76
+ .dev_id = "spi0",
77
+ .table = {
78
+ GPIO_LOOKUP("A", 1, "cs", GPIO_ACTIVE_LOW),
79
+ { },
80
+ },
7581 };
7682
7783 static struct ep93xx_spi_info simone_spi_info __initdata = {
78
- .chipselect = simone_spi_chipselects,
79
- .num_chipselect = ARRAY_SIZE(simone_spi_chipselects),
8084 .use_dma = 1,
8185 };
8286
....@@ -105,6 +109,8 @@
105109 ep93xx_register_fb(&simone_fb_info);
106110 ep93xx_register_i2c(simone_i2c_board_info,
107111 ARRAY_SIZE(simone_i2c_board_info));
112
+ gpiod_add_lookup_table(&simone_mmc_spi_gpio_table);
113
+ gpiod_add_lookup_table(&simone_spi_cs_gpio_table);
108114 ep93xx_register_spi(&simone_spi_info, simone_spi_devices,
109115 ARRAY_SIZE(simone_spi_devices));
110116 simone_register_audio();