123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- /* Copyright (c) 2013, The Linux Foundation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- */
- #include <linux/init.h>
- #include <linux/ioport.h>
- #include <mach/board.h>
- #include <mach/gpio.h>
- #include <mach/gpiomux.h>
- #define KS8851_IRQ_GPIO 75
- #if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
- static struct gpiomux_setting gpio_eth_config = {
- .pull = GPIOMUX_PULL_UP,
- .drv = GPIOMUX_DRV_2MA,
- .func = GPIOMUX_FUNC_GPIO,
- };
- static struct msm_gpiomux_config msm_eth_config[] = {
- {
- .gpio = KS8851_IRQ_GPIO,
- .settings = {
- [GPIOMUX_SUSPENDED] = &gpio_eth_config,
- }
- },
- };
- #endif
- static struct gpiomux_setting gpio_uart_config = {
- .func = GPIOMUX_FUNC_1,
- .drv = GPIOMUX_DRV_8MA,
- .pull = GPIOMUX_PULL_NONE,
- };
- static struct gpiomux_setting gpio_spi_config = {
- .func = GPIOMUX_FUNC_2,
- .drv = GPIOMUX_DRV_6MA,
- .pull = GPIOMUX_PULL_NONE,
- };
- static struct msm_gpiomux_config msm_blsp_configs[] __initdata = {
- {
- .gpio = 8, /* BLSP1 UART TX */
- .settings = {
- [GPIOMUX_SUSPENDED] = &gpio_uart_config,
- },
- },
- {
- .gpio = 9, /* BLSP1 UART RX */
- .settings = {
- [GPIOMUX_SUSPENDED] = &gpio_uart_config,
- },
- },
- {
- .gpio = 20, /* BLSP1 QUP6 SPI_DATA_MOSI */
- .settings = {
- [GPIOMUX_SUSPENDED] = &gpio_spi_config,
- },
- },
- {
- .gpio = 21, /* BLSP1 QUP6 SPI_DATA_MISO */
- .settings = {
- [GPIOMUX_SUSPENDED] = &gpio_spi_config,
- },
- },
- {
- .gpio = 23, /* BLSP1 QUP6 SPI_CLK */
- .settings = {
- [GPIOMUX_SUSPENDED] = &gpio_spi_config,
- },
- },
- {
- .gpio = 22, /* BLSP1 QUP6 SPI_CS */
- .settings = {
- [GPIOMUX_SUSPENDED] = &gpio_spi_config,
- },
- },
- };
- void __init msmkrypton_init_gpiomux(void)
- {
- int rc;
- rc = msm_gpiomux_init_dt();
- if (rc) {
- pr_err("%s failed %d\n", __func__, rc);
- return;
- }
- msm_gpiomux_install(msm_blsp_configs, ARRAY_SIZE(msm_blsp_configs));
- #if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
- msm_gpiomux_install(msm_eth_config, ARRAY_SIZE(msm_eth_config));
- #endif
- }
|