| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Support for the Arcom ZEUS. |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 5 | 6 | * |
|---|
| 6 | 7 | * Loosely based on Arcom's 2.6.16.28. |
|---|
| 7 | 8 | * Maintained by Marc Zyngier <maz@misterjones.org> |
|---|
| 8 | | - * |
|---|
| 9 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 10 | | - * it under the terms of the GNU General Public License version 2 as |
|---|
| 11 | | - * published by the Free Software Foundation. |
|---|
| 12 | 9 | */ |
|---|
| 13 | 10 | |
|---|
| 14 | 11 | #include <linux/cpufreq.h> |
|---|
| .. | .. |
|---|
| 16 | 13 | #include <linux/leds.h> |
|---|
| 17 | 14 | #include <linux/irq.h> |
|---|
| 18 | 15 | #include <linux/pm.h> |
|---|
| 16 | +#include <linux/property.h> |
|---|
| 19 | 17 | #include <linux/gpio.h> |
|---|
| 18 | +#include <linux/gpio/machine.h> |
|---|
| 20 | 19 | #include <linux/serial_8250.h> |
|---|
| 21 | 20 | #include <linux/dm9000.h> |
|---|
| 22 | 21 | #include <linux/mmc/host.h> |
|---|
| .. | .. |
|---|
| 29 | 28 | #include <linux/platform_data/i2c-pxa.h> |
|---|
| 30 | 29 | #include <linux/platform_data/pca953x.h> |
|---|
| 31 | 30 | #include <linux/apm-emulation.h> |
|---|
| 32 | | -#include <linux/can/platform/mcp251x.h> |
|---|
| 33 | 31 | #include <linux/regulator/fixed.h> |
|---|
| 34 | 32 | #include <linux/regulator/machine.h> |
|---|
| 35 | 33 | |
|---|
| .. | .. |
|---|
| 390 | 388 | }; |
|---|
| 391 | 389 | |
|---|
| 392 | 390 | /* SPI interface on SSP3 */ |
|---|
| 393 | | -static struct pxa2xx_spi_master pxa2xx_spi_ssp3_master_info = { |
|---|
| 391 | +static struct pxa2xx_spi_controller pxa2xx_spi_ssp3_master_info = { |
|---|
| 394 | 392 | .num_chipselect = 1, |
|---|
| 395 | 393 | .enable_dma = 1, |
|---|
| 396 | 394 | }; |
|---|
| .. | .. |
|---|
| 410 | 408 | static struct fixed_voltage_config can_regulator_pdata = { |
|---|
| 411 | 409 | .supply_name = "CAN_SHDN", |
|---|
| 412 | 410 | .microvolts = 3300000, |
|---|
| 413 | | - .gpio = ZEUS_CAN_SHDN_GPIO, |
|---|
| 414 | 411 | .init_data = &can_regulator_init_data, |
|---|
| 415 | 412 | }; |
|---|
| 416 | 413 | |
|---|
| .. | .. |
|---|
| 422 | 419 | }, |
|---|
| 423 | 420 | }; |
|---|
| 424 | 421 | |
|---|
| 425 | | -static struct mcp251x_platform_data zeus_mcp2515_pdata = { |
|---|
| 426 | | - .oscillator_frequency = 16*1000*1000, |
|---|
| 422 | +static struct gpiod_lookup_table can_regulator_gpiod_table = { |
|---|
| 423 | + .dev_id = "reg-fixed-voltage.0", |
|---|
| 424 | + .table = { |
|---|
| 425 | + GPIO_LOOKUP("gpio-pxa", ZEUS_CAN_SHDN_GPIO, |
|---|
| 426 | + NULL, GPIO_ACTIVE_LOW), |
|---|
| 427 | + { }, |
|---|
| 428 | + }, |
|---|
| 429 | +}; |
|---|
| 430 | + |
|---|
| 431 | +static const struct property_entry mcp251x_properties[] = { |
|---|
| 432 | + PROPERTY_ENTRY_U32("clock-frequency", 16000000), |
|---|
| 433 | + {} |
|---|
| 427 | 434 | }; |
|---|
| 428 | 435 | |
|---|
| 429 | 436 | static struct spi_board_info zeus_spi_board_info[] = { |
|---|
| 430 | 437 | [0] = { |
|---|
| 431 | 438 | .modalias = "mcp2515", |
|---|
| 432 | | - .platform_data = &zeus_mcp2515_pdata, |
|---|
| 439 | + .properties = mcp251x_properties, |
|---|
| 433 | 440 | .irq = PXA_GPIO_TO_IRQ(ZEUS_CAN_GPIO), |
|---|
| 434 | 441 | .max_speed_hz = 1*1000*1000, |
|---|
| 435 | 442 | .bus_num = 3, |
|---|
| .. | .. |
|---|
| 538 | 545 | static struct fixed_voltage_config zeus_ohci_regulator_config = { |
|---|
| 539 | 546 | .supply_name = "vbus2", |
|---|
| 540 | 547 | .microvolts = 5000000, /* 5.0V */ |
|---|
| 541 | | - .gpio = ZEUS_USB2_PWREN_GPIO, |
|---|
| 542 | | - .enable_high = 1, |
|---|
| 543 | 548 | .startup_delay = 0, |
|---|
| 544 | 549 | .init_data = &zeus_ohci_regulator_data, |
|---|
| 545 | 550 | }; |
|---|
| .. | .. |
|---|
| 549 | 554 | .id = 1, |
|---|
| 550 | 555 | .dev = { |
|---|
| 551 | 556 | .platform_data = &zeus_ohci_regulator_config, |
|---|
| 557 | + }, |
|---|
| 558 | +}; |
|---|
| 559 | + |
|---|
| 560 | +static struct gpiod_lookup_table zeus_ohci_regulator_gpiod_table = { |
|---|
| 561 | + .dev_id = "reg-fixed-voltage.0", |
|---|
| 562 | + .table = { |
|---|
| 563 | + GPIO_LOOKUP("gpio-pxa", ZEUS_USB2_PWREN_GPIO, |
|---|
| 564 | + NULL, GPIO_ACTIVE_HIGH), |
|---|
| 565 | + { }, |
|---|
| 552 | 566 | }, |
|---|
| 553 | 567 | }; |
|---|
| 554 | 568 | |
|---|
| .. | .. |
|---|
| 646 | 660 | static struct pxamci_platform_data zeus_mci_platform_data = { |
|---|
| 647 | 661 | .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, |
|---|
| 648 | 662 | .detect_delay_ms = 250, |
|---|
| 649 | | - .gpio_card_detect = ZEUS_MMC_CD_GPIO, |
|---|
| 650 | | - .gpio_card_ro = ZEUS_MMC_WP_GPIO, |
|---|
| 651 | 663 | .gpio_card_ro_invert = 1, |
|---|
| 652 | | - .gpio_power = -1 |
|---|
| 664 | +}; |
|---|
| 665 | + |
|---|
| 666 | +static struct gpiod_lookup_table zeus_mci_gpio_table = { |
|---|
| 667 | + .dev_id = "pxa2xx-mci.0", |
|---|
| 668 | + .table = { |
|---|
| 669 | + GPIO_LOOKUP("gpio-pxa", ZEUS_MMC_CD_GPIO, |
|---|
| 670 | + "cd", GPIO_ACTIVE_LOW), |
|---|
| 671 | + GPIO_LOOKUP("gpio-pxa", ZEUS_MMC_WP_GPIO, |
|---|
| 672 | + "wp", GPIO_ACTIVE_HIGH), |
|---|
| 673 | + { }, |
|---|
| 674 | + }, |
|---|
| 653 | 675 | }; |
|---|
| 654 | 676 | |
|---|
| 655 | 677 | /* |
|---|
| .. | .. |
|---|
| 855 | 877 | |
|---|
| 856 | 878 | pxa2xx_mfp_config(ARRAY_AND_SIZE(zeus_pin_config)); |
|---|
| 857 | 879 | |
|---|
| 880 | + gpiod_add_lookup_table(&can_regulator_gpiod_table); |
|---|
| 881 | + gpiod_add_lookup_table(&zeus_ohci_regulator_gpiod_table); |
|---|
| 858 | 882 | platform_add_devices(zeus_devices, ARRAY_SIZE(zeus_devices)); |
|---|
| 859 | 883 | |
|---|
| 860 | 884 | zeus_register_ohci(); |
|---|
| .. | .. |
|---|
| 864 | 888 | else |
|---|
| 865 | 889 | pxa_set_fb_info(NULL, &zeus_fb_info); |
|---|
| 866 | 890 | |
|---|
| 891 | + gpiod_add_lookup_table(&zeus_mci_gpio_table); |
|---|
| 867 | 892 | pxa_set_mci_info(&zeus_mci_platform_data); |
|---|
| 868 | 893 | pxa_set_udc_info(&zeus_udc_info); |
|---|
| 869 | 894 | pxa_set_ac97_info(&zeus_ac97_info); |
|---|