diff options
author | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2013-08-08 06:38:33 -0400 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2013-08-24 23:45:26 -0400 |
commit | 2a4f6b1daf552e6b2be83c381166b98f6deaa21a (patch) | |
tree | bd229a58acdf43cfcb40aa92251dd49b2a37a8e5 /arch | |
parent | bf287a90ceedf86e3313ba0dcff606ac5399b39a (diff) |
ARM: ep93xx: vision_ep9307: Use MMC CD and RO GPIO
Pass the CD and RO GPIO numbers to the MMC SPI driver and remove the
custom .get_cd() and .get_ro() callback functions.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-ep93xx/vision_ep9307.c | 57 |
1 files changed, 5 insertions, 52 deletions
diff --git a/arch/arm/mach-ep93xx/vision_ep9307.c b/arch/arm/mach-ep93xx/vision_ep9307.c index 605956fd07a2..5a4c06d1ad40 100644 --- a/arch/arm/mach-ep93xx/vision_ep9307.c +++ b/arch/arm/mach-ep93xx/vision_ep9307.c | |||
@@ -224,62 +224,15 @@ static struct ep93xx_spi_chip_ops vision_spi_flash_hw = { | |||
224 | #define VISION_SPI_MMC_WP EP93XX_GPIO_LINE_F(0) | 224 | #define VISION_SPI_MMC_WP EP93XX_GPIO_LINE_F(0) |
225 | #define VISION_SPI_MMC_CD EP93XX_GPIO_LINE_EGPIO15 | 225 | #define VISION_SPI_MMC_CD EP93XX_GPIO_LINE_EGPIO15 |
226 | 226 | ||
227 | static struct gpio vision_spi_mmc_gpios[] = { | ||
228 | { VISION_SPI_MMC_WP, GPIOF_DIR_IN, "mmc_spi:wp" }, | ||
229 | { VISION_SPI_MMC_CD, GPIOF_DIR_IN, "mmc_spi:cd" }, | ||
230 | }; | ||
231 | |||
232 | static int vision_spi_mmc_init(struct device *pdev, | ||
233 | irqreturn_t (*func)(int, void *), void *pdata) | ||
234 | { | ||
235 | int err; | ||
236 | |||
237 | err = gpio_request_array(vision_spi_mmc_gpios, | ||
238 | ARRAY_SIZE(vision_spi_mmc_gpios)); | ||
239 | if (err) | ||
240 | return err; | ||
241 | |||
242 | err = gpio_set_debounce(VISION_SPI_MMC_CD, 1); | ||
243 | if (err) | ||
244 | goto exit_err; | ||
245 | |||
246 | err = request_irq(gpio_to_irq(VISION_SPI_MMC_CD), func, | ||
247 | IRQ_TYPE_EDGE_BOTH, "mmc_spi:cd", pdata); | ||
248 | if (err) | ||
249 | goto exit_err; | ||
250 | |||
251 | return 0; | ||
252 | |||
253 | exit_err: | ||
254 | gpio_free_array(vision_spi_mmc_gpios, ARRAY_SIZE(vision_spi_mmc_gpios)); | ||
255 | return err; | ||
256 | |||
257 | } | ||
258 | |||
259 | static void vision_spi_mmc_exit(struct device *pdev, void *pdata) | ||
260 | { | ||
261 | free_irq(gpio_to_irq(VISION_SPI_MMC_CD), pdata); | ||
262 | gpio_free_array(vision_spi_mmc_gpios, ARRAY_SIZE(vision_spi_mmc_gpios)); | ||
263 | } | ||
264 | |||
265 | static int vision_spi_mmc_get_ro(struct device *pdev) | ||
266 | { | ||
267 | return !!gpio_get_value(VISION_SPI_MMC_WP); | ||
268 | } | ||
269 | |||
270 | static int vision_spi_mmc_get_cd(struct device *pdev) | ||
271 | { | ||
272 | return !gpio_get_value(VISION_SPI_MMC_CD); | ||
273 | } | ||
274 | |||
275 | static struct mmc_spi_platform_data vision_spi_mmc_data = { | 227 | static struct mmc_spi_platform_data vision_spi_mmc_data = { |
276 | .init = vision_spi_mmc_init, | ||
277 | .exit = vision_spi_mmc_exit, | ||
278 | .get_ro = vision_spi_mmc_get_ro, | ||
279 | .get_cd = vision_spi_mmc_get_cd, | ||
280 | .detect_delay = 100, | 228 | .detect_delay = 100, |
281 | .powerup_msecs = 100, | 229 | .powerup_msecs = 100, |
282 | .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, | 230 | .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, |
231 | .flags = MMC_SPI_USE_CD_GPIO | MMC_SPI_USE_RO_GPIO, | ||
232 | .cd_gpio = VISION_SPI_MMC_CD, | ||
233 | .cd_debounce = 1, | ||
234 | .ro_gpio = VISION_SPI_MMC_WP, | ||
235 | .caps2 = MMC_CAP2_RO_ACTIVE_HIGH, | ||
283 | }; | 236 | }; |
284 | 237 | ||
285 | static int vision_spi_mmc_hw_setup(struct spi_device *spi) | 238 | static int vision_spi_mmc_hw_setup(struct spi_device *spi) |