.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * arch/arm/mach-ep93xx/simone.c |
---|
3 | 4 | * Simplemachines Sim.One support. |
---|
.. | .. |
---|
7 | 8 | * Based on the 2.6.24.7 support: |
---|
8 | 9 | * Copyright (C) 2009 Simplemachines |
---|
9 | 10 | * 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 | | - * |
---|
16 | 11 | */ |
---|
17 | 12 | |
---|
18 | 13 | #include <linux/kernel.h> |
---|
.. | .. |
---|
25 | 20 | #include <linux/platform_data/video-ep93xx.h> |
---|
26 | 21 | #include <linux/platform_data/spi-ep93xx.h> |
---|
27 | 22 | #include <linux/gpio.h> |
---|
| 23 | +#include <linux/gpio/machine.h> |
---|
28 | 24 | |
---|
29 | | -#include <mach/hardware.h> |
---|
30 | | -#include <mach/gpio-ep93xx.h> |
---|
| 25 | +#include "hardware.h" |
---|
| 26 | +#include "gpio-ep93xx.h" |
---|
31 | 27 | |
---|
32 | 28 | #include <asm/mach-types.h> |
---|
33 | 29 | #include <asm/mach/arch.h> |
---|
.. | .. |
---|
45 | 41 | static struct mmc_spi_platform_data simone_mmc_spi_data = { |
---|
46 | 42 | .detect_delay = 500, |
---|
47 | 43 | .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 | + }, |
---|
51 | 53 | }; |
---|
52 | 54 | |
---|
53 | 55 | static struct spi_board_info simone_spi_devices[] __initdata = { |
---|
.. | .. |
---|
70 | 72 | * low between multi-message command blocks. From v1.4, it uses a GPIO instead. |
---|
71 | 73 | * v1.3 parts will still work, since the signal on SFRMOUT is automatic. |
---|
72 | 74 | */ |
---|
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 | + }, |
---|
75 | 81 | }; |
---|
76 | 82 | |
---|
77 | 83 | static struct ep93xx_spi_info simone_spi_info __initdata = { |
---|
78 | | - .chipselect = simone_spi_chipselects, |
---|
79 | | - .num_chipselect = ARRAY_SIZE(simone_spi_chipselects), |
---|
80 | 84 | .use_dma = 1, |
---|
81 | 85 | }; |
---|
82 | 86 | |
---|
.. | .. |
---|
105 | 109 | ep93xx_register_fb(&simone_fb_info); |
---|
106 | 110 | ep93xx_register_i2c(simone_i2c_board_info, |
---|
107 | 111 | 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); |
---|
108 | 114 | ep93xx_register_spi(&simone_spi_info, simone_spi_devices, |
---|
109 | 115 | ARRAY_SIZE(simone_spi_devices)); |
---|
110 | 116 | simone_register_audio(); |
---|