.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * linux/arch/arm/mach-pxa/cm-x300.c |
---|
3 | 4 | * |
---|
.. | .. |
---|
7 | 8 | * |
---|
8 | 9 | * Mike Rapoport <mike@compulab.co.il> |
---|
9 | 10 | * Igor Grinberg <grinberg@compulab.co.il> |
---|
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 version 2 as |
---|
13 | | - * published by the Free Software Foundation. |
---|
14 | 11 | */ |
---|
15 | 12 | #define pr_fmt(fmt) "%s: " fmt, __func__ |
---|
16 | 13 | |
---|
.. | .. |
---|
315 | 312 | static struct platform_pwm_backlight_data cm_x300_backlight_data = { |
---|
316 | 313 | .max_brightness = 100, |
---|
317 | 314 | .dft_brightness = 100, |
---|
318 | | - .enable_gpio = -1, |
---|
319 | 315 | }; |
---|
320 | 316 | |
---|
321 | 317 | static struct platform_device cm_x300_backlight_device = { |
---|
.. | .. |
---|
358 | 354 | static struct gpiod_lookup_table cm_x300_spi_gpiod_table = { |
---|
359 | 355 | .dev_id = "spi_gpio", |
---|
360 | 356 | .table = { |
---|
361 | | - GPIO_LOOKUP("gpio-pxa", GPIO_LCD_SCL, |
---|
| 357 | + GPIO_LOOKUP("pca9555.1", GPIO_LCD_SCL - GPIO_LCD_BASE, |
---|
362 | 358 | "sck", GPIO_ACTIVE_HIGH), |
---|
363 | | - GPIO_LOOKUP("gpio-pxa", GPIO_LCD_DIN, |
---|
| 359 | + GPIO_LOOKUP("pca9555.1", GPIO_LCD_DIN - GPIO_LCD_BASE, |
---|
364 | 360 | "mosi", GPIO_ACTIVE_HIGH), |
---|
365 | | - GPIO_LOOKUP("gpio-pxa", GPIO_LCD_DOUT, |
---|
| 361 | + GPIO_LOOKUP("pca9555.1", GPIO_LCD_DOUT - GPIO_LCD_BASE, |
---|
366 | 362 | "miso", GPIO_ACTIVE_HIGH), |
---|
367 | | - GPIO_LOOKUP("gpio-pxa", GPIO_LCD_CS, |
---|
| 363 | + GPIO_LOOKUP("pca9555.1", GPIO_LCD_CS - GPIO_LCD_BASE, |
---|
368 | 364 | "cs", GPIO_ACTIVE_HIGH), |
---|
369 | 365 | { }, |
---|
370 | 366 | }, |
---|
.. | .. |
---|
459 | 455 | static struct pxamci_platform_data cm_x300_mci_platform_data = { |
---|
460 | 456 | .detect_delay_ms = 200, |
---|
461 | 457 | .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, |
---|
462 | | - .gpio_card_detect = GPIO82_MMC_IRQ, |
---|
463 | | - .gpio_card_ro = GPIO85_MMC_WP, |
---|
464 | | - .gpio_power = -1, |
---|
| 458 | +}; |
---|
| 459 | + |
---|
| 460 | +static struct gpiod_lookup_table cm_x300_mci_gpio_table = { |
---|
| 461 | + .dev_id = "pxa2xx-mci.0", |
---|
| 462 | + .table = { |
---|
| 463 | + /* Card detect on GPIO 82 */ |
---|
| 464 | + GPIO_LOOKUP("gpio-pxa", GPIO82_MMC_IRQ, "cd", GPIO_ACTIVE_LOW), |
---|
| 465 | + /* Write protect on GPIO 85 */ |
---|
| 466 | + GPIO_LOOKUP("gpio-pxa", GPIO85_MMC_WP, "wp", GPIO_ACTIVE_LOW), |
---|
| 467 | + { }, |
---|
| 468 | + }, |
---|
465 | 469 | }; |
---|
466 | 470 | |
---|
467 | 471 | /* The second MMC slot of CM-X300 is hardwired to Libertas card and has |
---|
.. | .. |
---|
482 | 486 | .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, |
---|
483 | 487 | .init = cm_x300_mci2_init, |
---|
484 | 488 | .exit = cm_x300_mci2_exit, |
---|
485 | | - .gpio_card_detect = -1, |
---|
486 | | - .gpio_card_ro = -1, |
---|
487 | | - .gpio_power = -1, |
---|
488 | 489 | }; |
---|
489 | 490 | |
---|
490 | 491 | static void __init cm_x300_init_mmc(void) |
---|
491 | 492 | { |
---|
| 493 | + gpiod_add_lookup_table(&cm_x300_mci_gpio_table); |
---|
492 | 494 | pxa_set_mci_info(&cm_x300_mci_platform_data); |
---|
493 | 495 | pxa3xx_set_mci2_info(&cm_x300_mci2_platform_data); |
---|
494 | 496 | } |
---|