M7350v3_en_gpl

This commit is contained in:
T
2024-09-09 08:55:19 +00:00
parent 801e6d2ad8
commit 2d95e8761a
2791 changed files with 89608 additions and 390711 deletions

39
kernel/arch/arm/mach-msm/Kconfig Executable file → Normal file
View File

@ -3047,43 +3047,4 @@ config WALL_CLK_SYSFS
Support the wallclk directory in sysfs filesystem to enable the
wall clock simulation and read the current SFN.
config TPLINK_PMIC_EXT
bool "Some interfaces for User Layer Support"
default n
config TPLINK_PRODUCT_TR961_5200L_V1
bool "Specify product type tr961-5200l-v1"
default n
config TPLINK_PRODUCT_TR961_5200L_V2
bool "Specify product type tr961-5200l-v2"
default n
config TPLINK_PRODUCT_TR961_2500L_MOBILE_UNICOM_V1
bool "Specify product type tr961-2500l-mobile-unicom-v1"
default n
config TPLINK_PRODUCT_M7350_UN_V1
bool "Specify product type m7350-un-v1"
default n
config TPLINK_PRODUCT_M7350_UN_V2
bool "Specify product type m7350-un-v2"
default n
config TPLINK_PRODUCT_M7350_UN_V3
bool "Specify product type m7350-un-v3"
default n
config TPLINK_PRODUCT_M7300_UN_V1
bool "Specify product type m7300-un-v1"
default n
config TPLINK_FEATURE_LED
bool "feature led"
default n
config TPLINK_PRODUCT_LTE_MODULE_V1
bool "Specify product type lte-module-v1"
default n
endif

39
kernel/arch/arm/mach-msm/Makefile Executable file → Normal file
View File

@ -299,42 +299,7 @@ obj-$(CONFIG_ARCH_MPQ8092) += gdsc.o
obj-$(CONFIG_ARCH_MSM8974) += krait-regulator.o
obj-$(CONFIG_ARCH_MSMKRYPTON) += board-krypton.o board-krypton-gpiomux.o
obj-$(CONFIG_ARCH_MSMSAMARIUM) += board-samarium.o board-samarium-gpiomux.o
product_gpio = board-9625-gpiomux.o
ifdef CONFIG_TPLINK_PRODUCT_TR961_5200L_V1
product_gpio = board-tr961-5200l-v1-gpiomux.o
endif
ifdef CONFIG_TPLINK_PRODUCT_TR961_5200L_V2
product_gpio = board-tr961-5200l-v2-gpiomux.o
endif
ifdef CONFIG_TPLINK_PRODUCT_LTE_MODULE_V1
product_gpio = board-lte-module-v1-gpiomux.o
endif
ifdef CONFIG_TPLINK_PRODUCT_M7300_UN_V1
product_gpio = board-m7300-un-v1-gpiomux.o
endif
ifdef CONFIG_TPLINK_PRODUCT_M7350_UN_V2
product_gpio = board-m7350-un-v2-gpiomux.o
endif
ifdef CONFIG_TPLINK_PRODUCT_M7350_UN_V3
product_gpio = board-m7350-un-v3-gpiomux.o
endif
ifdef CONFIG_TPLINK_PRODUCT_TR961_2500L_MOBILE_UNICOM_V1
product_gpio = board-tr961-2500l-mobile-unicom-v1-gpiomux.o
endif
ifdef CONFIG_TPLINK_PRODUCT_M7350_UN_V1
product_gpio = board-m7350-un-v1-gpiomux.o
endif
obj-$(CONFIG_ARCH_MSM9625) += board-9625.o $(product_gpio)
obj-$(CONFIG_ARCH_MSM9625) += board-9625.o board-9625-gpiomux.o
obj-$(CONFIG_ARCH_MSM9625) += clock-local2.o clock-pll.o clock-9625.o clock-rpm.o clock-voter.o acpuclock-9625.o acpuclock-cortex.o
obj-$(CONFIG_ARCH_MSM8930) += acpuclock-8930.o acpuclock-8627.o acpuclock-8930aa.o acpuclock-8930ab.o
obj-$(CONFIG_ARCH_MPQ8092) += board-8092.o board-8092-gpiomux.o
@ -465,5 +430,3 @@ obj-$(CONFIG_WALL_CLK) += wallclk.o
obj-$(CONFIG_WALL_CLK_SYSFS) += wallclk_sysfs.o
obj-$(CONFIG_ARCH_RANDOM) += early_random.o
obj-$(CONFIG_TPLINK_PMIC_EXT) += pm8019_ext.o

120
kernel/arch/arm/mach-msm/board-9625-gpiomux.c Executable file → Normal file
View File

@ -105,20 +105,6 @@ static struct gpiomux_setting mi2s_suspend_cfg = {
.pull = GPIOMUX_PULL_DOWN,
};
/* [houjihai start] */
static struct gpiomux_setting key_active_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_8MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct gpiomux_setting key_suspend_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_8MA,
.pull = GPIOMUX_PULL_NONE,
};
/* [houjihai end] */
static struct gpiomux_setting codec_reset = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_6MA,
@ -134,8 +120,6 @@ static struct msm_gpiomux_config mdm9625_mi2s_configs[] __initdata = {
[GPIOMUX_ACTIVE] = &mi2s_active_cfg,
},
},
/* [houjihai start] init gpio15 in key configs struct and init gpio14 here depends on wps */
#if 0
{
.gpio = 15, /* mi2s sclk */
.settings = {
@ -143,8 +127,6 @@ static struct msm_gpiomux_config mdm9625_mi2s_configs[] __initdata = {
[GPIOMUX_ACTIVE] = &mi2s_active_cfg,
},
},
#endif
#ifndef INCLUDE_WPS_KEY
{
.gpio = 14, /* mi2s dout */
.settings = {
@ -152,8 +134,6 @@ static struct msm_gpiomux_config mdm9625_mi2s_configs[] __initdata = {
[GPIOMUX_ACTIVE] = &mi2s_active_cfg,
},
},
#endif
/* [houjihai end] */
{
.gpio = 13, /* mi2s din */
.settings = {
@ -170,27 +150,6 @@ static struct msm_gpiomux_config mdm9625_mi2s_configs[] __initdata = {
},
};
/* [houjihai start] gpio14 for wps key and gpio15 for reset*/
static struct msm_gpiomux_config mdm9625_key_configs[] __initdata = {
#ifdef INCLUDE_WPS_KEY
{
.gpio = 14,
.settings = {
[GPIOMUX_SUSPENDED] = &key_suspend_cfg,
[GPIOMUX_ACTIVE] = &key_active_cfg,
},
},
#endif
{
.gpio = 15,
.settings = {
[GPIOMUX_SUSPENDED] = &key_suspend_cfg,
[GPIOMUX_ACTIVE] = &key_active_cfg,
},
},
};
/* [houjihai end] */
static struct msm_gpiomux_config mdm9625_cdc_reset_config[] __initdata = {
{
.gpio = 22, /* SYS_RST_N */
@ -380,76 +339,6 @@ static void msm9625_disp_init_gpiomux(void)
}
#endif /* CONFIG_FB_MSM_QPIC */
#ifdef CONFIG_MP2617_CHARGER
static struct gpiomux_setting mp2617_gpio_input_active_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
.dir = GPIOMUX_IN,
};
static struct gpiomux_setting mp2617_gpio_input_suspend_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
.dir = GPIOMUX_IN,
};
static struct gpiomux_setting mp2617_gpio_output_active_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct gpiomux_setting mp2617_gpio_output_suspend_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
};
/* refer to msm9625-mtp.dtsi */
static struct msm_gpiomux_config msm9625_mp2617_configs[] __initdata = {
{
.gpio = 13, /* Charge Enable, 1: Enable, 0: Disable */
.settings = {
[GPIOMUX_ACTIVE] = &mp2617_gpio_output_active_cfg,
[GPIOMUX_SUSPENDED] = &mp2617_gpio_output_suspend_cfg,
},
},
{
.gpio = 16, /* M0 */
.settings = {
[GPIOMUX_ACTIVE] = &mp2617_gpio_output_active_cfg,
[GPIOMUX_SUSPENDED] = &mp2617_gpio_output_suspend_cfg,
},
},
{
.gpio = 17, /* M1 */
.settings = {
[GPIOMUX_ACTIVE] = &mp2617_gpio_output_active_cfg,
[GPIOMUX_SUSPENDED] = &mp2617_gpio_output_suspend_cfg,
},
},
{
.gpio = 70, /* CHGOK, 0: Charging, 1: Complete */
.settings = {
[GPIOMUX_ACTIVE] = &mp2617_gpio_input_active_cfg,
[GPIOMUX_SUSPENDED] = &mp2617_gpio_input_suspend_cfg,
},
},
#ifdef CONFIG_POWER_BANK_DETECT_SUPPORT
{
.gpio = 14, /* Boost_EN, 0: Disbale, 1: Enable */
.settings = {
[GPIOMUX_ACTIVE] = &mp2617_gpio_output_active_cfg,
[GPIOMUX_SUSPENDED] = &mp2617_gpio_output_suspend_cfg,
},
},
#endif
};
#endif
void __init msm9625_init_gpiomux(void)
{
int rc;
@ -466,18 +355,9 @@ void __init msm9625_init_gpiomux(void)
ARRAY_SIZE(wlan_ath6kl_configs));
msm_gpiomux_install(mdm9625_mi2s_configs,
ARRAY_SIZE(mdm9625_mi2s_configs));
/* [houjihai start] */
msm_gpiomux_install(mdm9625_key_configs,
ARRAY_SIZE(mdm9625_key_configs));
/* [houjihai end] */
msm_gpiomux_install(mdm9625_cdc_reset_config,
ARRAY_SIZE(mdm9625_cdc_reset_config));
msm_gpiomux_install(sdc2_card_det_config,
ARRAY_SIZE(sdc2_card_det_config));
msm9625_disp_init_gpiomux();
#ifdef CONFIG_MP2617_CHARGER
msm_gpiomux_install(msm9625_mp2617_configs,
ARRAY_SIZE(msm9625_mp2617_configs));
#endif
}

3
kernel/arch/arm/mach-msm/board-9625.c Executable file → Normal file
View File

@ -44,7 +44,6 @@
#include "modem_notifier.h"
#include "lpm_resources.h"
#include "spm.h"
#include "pm8019_ext.h"
#define MSM_KERNEL_EBI_SIZE 0x51000
@ -254,8 +253,6 @@ void __init msm9625_init(void)
msm9625_init_gpiomux();
board_dt_populate(msm9625_auxdata_lookup);
msm9625_add_drivers();
export_pmic_interface();
}
DT_MACHINE_START(MSM9625_DT, "Qualcomm MSM 9625 (Flattened Device Tree)")

View File

@ -1,404 +0,0 @@
/* Copyright (c) 2012-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>
static struct gpiomux_setting gpio_uart_config = {
.func = GPIOMUX_FUNC_1,
.drv = GPIOMUX_DRV_8MA,
.pull = GPIOMUX_PULL_NONE,
.dir = GPIOMUX_OUT_HIGH,
};
#ifndef CONFIG_TPLINK_FEATURE_LED
static struct gpiomux_setting gpio_spi_cs_config = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_12MA,
.pull = GPIOMUX_PULL_NONE,
};
#endif
static struct gpiomux_setting gpio_spi_cs_suspend_config = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_12MA,
.pull = GPIOMUX_PULL_UP,
};
static struct gpiomux_setting gpio_spi_cs_active_up_config = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_12MA,
.pull = GPIOMUX_PULL_UP,
};
#ifndef CONFIG_TPLINK_FEATURE_LED
static struct gpiomux_setting gpio_spi_config = {
.func = GPIOMUX_FUNC_1,
.drv = GPIOMUX_DRV_12MA,
.pull = GPIOMUX_PULL_NONE,
};
#endif
static struct gpiomux_setting gpio_i2c_config = {
.func = GPIOMUX_FUNC_3,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
};
#ifndef CONFIG_TPLINK_FEATURE_LED
static struct gpiomux_setting gpio_spi_cs_active_config = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_8MA,
.pull = GPIOMUX_PULL_NONE,
};
#endif
static struct msm_gpiomux_config msm_blsp_configs[] __initdata = {
#ifndef CONFIG_TPLINK_FEATURE_LED
{
.gpio = 4, /* BLSP1 QUP2 SPI_DATA_MOSI */
.settings = {
[GPIOMUX_SUSPENDED] = &gpio_spi_config,
},
},
{
.gpio = 5, /* BLSP1 QUP2 SPI_DATA_MISO */
.settings = {
[GPIOMUX_SUSPENDED] = &gpio_spi_config,
},
},
{
.gpio = 6, /* BLSP1 QUP2 SPI_CS_N */
.settings = {
[GPIOMUX_ACTIVE] = &gpio_spi_cs_active_config,
[GPIOMUX_SUSPENDED] = &gpio_spi_cs_config,
},
},
{
.gpio = 7, /* BLSP1 QUP2 SPI_CLK */
.settings = {
[GPIOMUX_SUSPENDED] = &gpio_spi_config,
},
},
#endif
{
.gpio = 8, /* BLSP1 UART TX */
.settings = {
[GPIOMUX_SUSPENDED] = &gpio_uart_config,
},
},
{
.gpio = 9, /* BLSP1 UART RX */
.settings = {
[GPIOMUX_SUSPENDED] = &gpio_uart_config,
},
},
{
.gpio = 10, /* BLSP1 QUP3 I2C_DAT */
.settings = {
[GPIOMUX_SUSPENDED] = &gpio_i2c_config,
},
},
{
.gpio = 11, /* BLSP1 QUP3 I2C_CLK */
.settings = {
[GPIOMUX_SUSPENDED] = &gpio_i2c_config,
},
},
{
.gpio = 61,
.settings = {
[GPIOMUX_ACTIVE] = &gpio_spi_cs_active_up_config,
[GPIOMUX_SUSPENDED] = &gpio_spi_cs_suspend_config,
},
},
};
/* [houjihai start] */
static struct gpiomux_setting key_active_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_8MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct gpiomux_setting key_suspend_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_8MA,
.pull = GPIOMUX_PULL_NONE,
};
/* [houjihai end] */
/* [houjihai start] gpio14 for wps key and gpio15 for reset*/
static struct msm_gpiomux_config mdm9625_key_configs[] __initdata = {
{
.gpio = 14,
.settings = {
[GPIOMUX_SUSPENDED] = &key_suspend_cfg,
[GPIOMUX_ACTIVE] = &key_active_cfg,
},
},
{
.gpio = 15,
.settings = {
[GPIOMUX_SUSPENDED] = &key_suspend_cfg,
[GPIOMUX_ACTIVE] = &key_active_cfg,
},
},
};
/* [houjihai end] */
static struct gpiomux_setting wlan_ath6kl_active_config = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
.dir = GPIOMUX_OUT_LOW,
};
static struct gpiomux_setting wlan_ath6kl_suspend_config = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
.dir = GPIOMUX_IN,
};
static struct msm_gpiomux_config wlan_ath6kl_configs[] __initdata = {
{
.gpio = 62,/* CHIP_PWD_L */
.settings = {
[GPIOMUX_ACTIVE] = &wlan_ath6kl_active_config,
[GPIOMUX_SUSPENDED] = &wlan_ath6kl_suspend_config,
},
},
};
static struct gpiomux_setting sdc2_card_det_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_DOWN,
.dir = GPIOMUX_IN,
};
struct msm_gpiomux_config sdc2_card_det_config[] __initdata = {
{
.gpio = 66,
.settings = {
[GPIOMUX_ACTIVE] = &sdc2_card_det_cfg,
[GPIOMUX_SUSPENDED] = &sdc2_card_det_cfg,
},
},
};
#ifdef CONFIG_FB_MSM_QPIC
static struct gpiomux_setting qpic_lcdc_a_d = {
.func = GPIOMUX_FUNC_1,
.drv = GPIOMUX_DRV_10MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct gpiomux_setting qpic_lcdc_cs = {
.func = GPIOMUX_FUNC_1,
.drv = GPIOMUX_DRV_10MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct gpiomux_setting qpic_lcdc_rs = {
.func = GPIOMUX_FUNC_1,
.drv = GPIOMUX_DRV_10MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct gpiomux_setting qpic_lcdc_te = {
.func = GPIOMUX_FUNC_7,
.drv = GPIOMUX_DRV_10MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct msm_gpiomux_config msm9625_qpic_lcdc_configs[] __initdata = {
{
.gpio = 20, /* a_d */
.settings = {
[GPIOMUX_SUSPENDED] = &qpic_lcdc_a_d,
},
},
{
.gpio = 21, /* cs */
.settings = {
[GPIOMUX_SUSPENDED] = &qpic_lcdc_cs,
},
},
{
.gpio = 22, /* te */
.settings = {
[GPIOMUX_SUSPENDED] = &qpic_lcdc_te,
},
},
{
.gpio = 23, /* rs */
.settings = {
[GPIOMUX_SUSPENDED] = &qpic_lcdc_rs,
},
},
};
static void msm9625_disp_init_gpiomux(void)
{
msm_gpiomux_install(msm9625_qpic_lcdc_configs,
ARRAY_SIZE(msm9625_qpic_lcdc_configs));
}
#else
static void msm9625_disp_init_gpiomux(void)
{
}
#endif /* CONFIG_FB_MSM_QPIC */
#ifdef CONFIG_MP2617_CHARGER
static struct gpiomux_setting mp2617_gpio_input_active_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
.dir = GPIOMUX_IN,
};
static struct gpiomux_setting mp2617_gpio_input_suspend_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
.dir = GPIOMUX_IN,
};
static struct gpiomux_setting mp2617_gpio_output_active_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct gpiomux_setting mp2617_gpio_output_suspend_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
};
/* refer to msm9625-mtp.dtsi */
static struct msm_gpiomux_config msm9625_mp2617_configs[] __initdata = {
{
.gpio = 13, /* Charge Enable, 1: Enable, 0: Disable */
.settings = {
[GPIOMUX_ACTIVE] = &mp2617_gpio_output_active_cfg,
[GPIOMUX_SUSPENDED] = &mp2617_gpio_output_suspend_cfg,
},
},
{
.gpio = 12, /* M0 */
.settings = {
[GPIOMUX_ACTIVE] = &mp2617_gpio_output_active_cfg,
[GPIOMUX_SUSPENDED] = &mp2617_gpio_output_suspend_cfg,
},
},
{
.gpio = 17, /* M1 */
.settings = {
[GPIOMUX_ACTIVE] = &mp2617_gpio_output_active_cfg,
[GPIOMUX_SUSPENDED] = &mp2617_gpio_output_suspend_cfg,
},
},
{
.gpio = 71, /* CHGOK, 0: Charging, 1: Complete */
.settings = {
[GPIOMUX_ACTIVE] = &mp2617_gpio_input_active_cfg,
[GPIOMUX_SUSPENDED] = &mp2617_gpio_input_suspend_cfg,
},
},
};
#endif
#ifdef CONFIG_TPLINK_FEATURE_LED
static struct gpiomux_setting leds_gpio_active_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_8MA,
.pull = GPIOMUX_PULL_NONE,
.dir = GPIOMUX_OUT_HIGH,
};
static struct gpiomux_setting leds_gpio_suspend_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct msm_gpiomux_config mdm9625_leds_gpio_configs[] __initdata = {
{
.gpio = 4,
.settings = {
[GPIOMUX_ACTIVE] = &leds_gpio_active_cfg,
[GPIOMUX_SUSPENDED] = &leds_gpio_suspend_cfg,
},
},
{
.gpio = 5,
.settings = {
[GPIOMUX_ACTIVE] = &leds_gpio_active_cfg,
[GPIOMUX_SUSPENDED] = &leds_gpio_suspend_cfg,
},
},
{
.gpio = 6,
.settings = {
[GPIOMUX_ACTIVE] = &leds_gpio_active_cfg,
[GPIOMUX_SUSPENDED] = &leds_gpio_suspend_cfg,
},
},
{
.gpio = 7,
.settings = {
[GPIOMUX_ACTIVE] = &leds_gpio_active_cfg,
[GPIOMUX_SUSPENDED] = &leds_gpio_suspend_cfg,
},
},
};
#endif
void __init msm9625_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));
msm_gpiomux_install(wlan_ath6kl_configs,
ARRAY_SIZE(wlan_ath6kl_configs));
/* [houjihai start] */
msm_gpiomux_install(mdm9625_key_configs,
ARRAY_SIZE(mdm9625_key_configs));
/* [houjihai end] */
#ifdef CONFIG_TPLINK_FEATURE_LED
msm_gpiomux_install(mdm9625_leds_gpio_configs,
ARRAY_SIZE(mdm9625_leds_gpio_configs));
#endif
msm_gpiomux_install(sdc2_card_det_config,
ARRAY_SIZE(sdc2_card_det_config));
msm9625_disp_init_gpiomux();
#ifdef CONFIG_MP2617_CHARGER
msm_gpiomux_install(msm9625_mp2617_configs,
ARRAY_SIZE(msm9625_mp2617_configs));
#endif
}

View File

@ -1,344 +0,0 @@
/* Copyright (c) 2012-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>
static struct gpiomux_setting gpio_uart_config = {
.func = GPIOMUX_FUNC_1,
.drv = GPIOMUX_DRV_8MA,
.pull = GPIOMUX_PULL_NONE,
.dir = GPIOMUX_OUT_HIGH,
};
static struct gpiomux_setting gpio_spi_cs_config = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_12MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct gpiomux_setting gpio_spi_cs_suspend_config = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_12MA,
.pull = GPIOMUX_PULL_UP,
};
static struct gpiomux_setting gpio_spi_cs_active_up_config = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_12MA,
.pull = GPIOMUX_PULL_UP,
};
static struct gpiomux_setting gpio_spi_config = {
.func = GPIOMUX_FUNC_1,
.drv = GPIOMUX_DRV_12MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct gpiomux_setting gpio_i2c_config = {
.func = GPIOMUX_FUNC_3,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct gpiomux_setting gpio_spi_cs_active_config = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_8MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct msm_gpiomux_config msm_blsp_configs[] __initdata = {
{
.gpio = 4, /* BLSP1 QUP2 SPI_DATA_MOSI */
.settings = {
[GPIOMUX_SUSPENDED] = &gpio_spi_config,
},
},
{
.gpio = 5, /* BLSP1 QUP2 SPI_DATA_MISO */
.settings = {
[GPIOMUX_SUSPENDED] = &gpio_spi_config,
},
},
{
.gpio = 6, /* BLSP1 QUP2 SPI_CS_N */
.settings = {
[GPIOMUX_ACTIVE] = &gpio_spi_cs_active_config,
[GPIOMUX_SUSPENDED] = &gpio_spi_cs_config,
},
},
{
.gpio = 7, /* BLSP1 QUP2 SPI_CLK */
.settings = {
[GPIOMUX_SUSPENDED] = &gpio_spi_config,
},
},
{
.gpio = 8, /* BLSP1 UART TX */
.settings = {
[GPIOMUX_SUSPENDED] = &gpio_uart_config,
},
},
{
.gpio = 9, /* BLSP1 UART RX */
.settings = {
[GPIOMUX_SUSPENDED] = &gpio_uart_config,
},
},
{
.gpio = 10, /* BLSP1 QUP3 I2C_DAT */
.settings = {
[GPIOMUX_SUSPENDED] = &gpio_i2c_config,
},
},
{
.gpio = 11, /* BLSP1 QUP3 I2C_CLK */
.settings = {
[GPIOMUX_SUSPENDED] = &gpio_i2c_config,
},
},
{
.gpio = 61,
.settings = {
[GPIOMUX_ACTIVE] = &gpio_spi_cs_active_up_config,
[GPIOMUX_SUSPENDED] = &gpio_spi_cs_suspend_config,
},
},
};
/* [houjihai start] */
static struct gpiomux_setting key_active_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_8MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct gpiomux_setting key_suspend_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_8MA,
.pull = GPIOMUX_PULL_NONE,
};
/* [houjihai end] */
/* [houjihai start] gpio14 for wps key and gpio15 for reset*/
static struct msm_gpiomux_config mdm9625_key_configs[] __initdata = {
{
.gpio = 14,
.settings = {
[GPIOMUX_SUSPENDED] = &key_suspend_cfg,
[GPIOMUX_ACTIVE] = &key_active_cfg,
},
},
{
.gpio = 15,
.settings = {
[GPIOMUX_SUSPENDED] = &key_suspend_cfg,
[GPIOMUX_ACTIVE] = &key_active_cfg,
},
},
};
/* [houjihai end] */
static struct gpiomux_setting wlan_ath6kl_active_config = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
.dir = GPIOMUX_OUT_LOW,
};
static struct gpiomux_setting wlan_ath6kl_suspend_config = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
.dir = GPIOMUX_IN,
};
static struct msm_gpiomux_config wlan_ath6kl_configs[] __initdata = {
{
.gpio = 62,/* CHIP_PWD_L */
.settings = {
[GPIOMUX_ACTIVE] = &wlan_ath6kl_active_config,
[GPIOMUX_SUSPENDED] = &wlan_ath6kl_suspend_config,
},
},
};
static struct gpiomux_setting sdc2_card_det_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_DOWN,
.dir = GPIOMUX_IN,
};
struct msm_gpiomux_config sdc2_card_det_config[] __initdata = {
{
.gpio = 66,
.settings = {
[GPIOMUX_ACTIVE] = &sdc2_card_det_cfg,
[GPIOMUX_SUSPENDED] = &sdc2_card_det_cfg,
},
},
};
#ifdef CONFIG_FB_MSM_QPIC
static struct gpiomux_setting qpic_lcdc_a_d = {
.func = GPIOMUX_FUNC_1,
.drv = GPIOMUX_DRV_10MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct gpiomux_setting qpic_lcdc_cs = {
.func = GPIOMUX_FUNC_1,
.drv = GPIOMUX_DRV_10MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct gpiomux_setting qpic_lcdc_rs = {
.func = GPIOMUX_FUNC_1,
.drv = GPIOMUX_DRV_10MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct gpiomux_setting qpic_lcdc_te = {
.func = GPIOMUX_FUNC_7,
.drv = GPIOMUX_DRV_10MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct msm_gpiomux_config msm9625_qpic_lcdc_configs[] __initdata = {
{
.gpio = 20, /* a_d */
.settings = {
[GPIOMUX_SUSPENDED] = &qpic_lcdc_a_d,
},
},
{
.gpio = 21, /* cs */
.settings = {
[GPIOMUX_SUSPENDED] = &qpic_lcdc_cs,
},
},
{
.gpio = 22, /* te */
.settings = {
[GPIOMUX_SUSPENDED] = &qpic_lcdc_te,
},
},
{
.gpio = 23, /* rs */
.settings = {
[GPIOMUX_SUSPENDED] = &qpic_lcdc_rs,
},
},
};
static void msm9625_disp_init_gpiomux(void)
{
msm_gpiomux_install(msm9625_qpic_lcdc_configs,
ARRAY_SIZE(msm9625_qpic_lcdc_configs));
}
#else
static void msm9625_disp_init_gpiomux(void)
{
}
#endif /* CONFIG_FB_MSM_QPIC */
#ifdef CONFIG_MP2617_CHARGER
static struct gpiomux_setting mp2617_gpio_input_active_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
.dir = GPIOMUX_IN,
};
static struct gpiomux_setting mp2617_gpio_input_suspend_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
.dir = GPIOMUX_IN,
};
static struct gpiomux_setting mp2617_gpio_output_active_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct gpiomux_setting mp2617_gpio_output_suspend_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
};
/* refer to msm9625-mtp.dtsi */
static struct msm_gpiomux_config msm9625_mp2617_configs[] __initdata = {
{
.gpio = 13, /* Charge Enable, 1: Enable, 0: Disable */
.settings = {
[GPIOMUX_ACTIVE] = &mp2617_gpio_output_active_cfg,
[GPIOMUX_SUSPENDED] = &mp2617_gpio_output_suspend_cfg,
},
},
{
.gpio = 12, /* M0 */
.settings = {
[GPIOMUX_ACTIVE] = &mp2617_gpio_output_active_cfg,
[GPIOMUX_SUSPENDED] = &mp2617_gpio_output_suspend_cfg,
},
},
{
.gpio = 17, /* M1 */
.settings = {
[GPIOMUX_ACTIVE] = &mp2617_gpio_output_active_cfg,
[GPIOMUX_SUSPENDED] = &mp2617_gpio_output_suspend_cfg,
},
},
{
.gpio = 71, /* CHGOK, 0: Charging, 1: Complete */
.settings = {
[GPIOMUX_ACTIVE] = &mp2617_gpio_input_active_cfg,
[GPIOMUX_SUSPENDED] = &mp2617_gpio_input_suspend_cfg,
},
},
};
#endif
void __init msm9625_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));
msm_gpiomux_install(wlan_ath6kl_configs,
ARRAY_SIZE(wlan_ath6kl_configs));
/* [houjihai start] */
msm_gpiomux_install(mdm9625_key_configs,
ARRAY_SIZE(mdm9625_key_configs));
/* [houjihai end] */
msm_gpiomux_install(sdc2_card_det_config,
ARRAY_SIZE(sdc2_card_det_config));
msm9625_disp_init_gpiomux();
#ifdef CONFIG_MP2617_CHARGER
msm_gpiomux_install(msm9625_mp2617_configs,
ARRAY_SIZE(msm9625_mp2617_configs));
#endif
}

View File

@ -1,381 +0,0 @@
/* Copyright (c) 2012-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>
static struct gpiomux_setting gpio_uart_config = {
.func = GPIOMUX_FUNC_1,
.drv = GPIOMUX_DRV_8MA,
.pull = GPIOMUX_PULL_NONE,
.dir = GPIOMUX_OUT_HIGH,
};
static struct gpiomux_setting gpio_spi_cs_config = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_12MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct gpiomux_setting gpio_spi_cs_suspend_config = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_12MA,
.pull = GPIOMUX_PULL_UP,
};
static struct gpiomux_setting gpio_spi_cs_active_up_config = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_12MA,
.pull = GPIOMUX_PULL_UP,
};
static struct gpiomux_setting gpio_spi_config = {
.func = GPIOMUX_FUNC_1,
.drv = GPIOMUX_DRV_12MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct gpiomux_setting gpio_i2c_config = {
.func = GPIOMUX_FUNC_3,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct gpiomux_setting gpio_spi_cs_active_config = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_8MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct msm_gpiomux_config msm_blsp_configs[] __initdata = {
{
.gpio = 4, /* BLSP1 QUP2 SPI_DATA_MOSI */
.settings = {
[GPIOMUX_SUSPENDED] = &gpio_spi_config,
},
},
{
.gpio = 5, /* BLSP1 QUP2 SPI_DATA_MISO */
.settings = {
[GPIOMUX_SUSPENDED] = &gpio_spi_config,
},
},
{
.gpio = 6, /* BLSP1 QUP2 SPI_CS_N */
.settings = {
[GPIOMUX_ACTIVE] = &gpio_spi_cs_active_config,
[GPIOMUX_SUSPENDED] = &gpio_spi_cs_config,
},
},
{
.gpio = 7, /* BLSP1 QUP2 SPI_CLK */
.settings = {
[GPIOMUX_SUSPENDED] = &gpio_spi_config,
},
},
{
.gpio = 8, /* BLSP1 UART TX */
.settings = {
[GPIOMUX_SUSPENDED] = &gpio_uart_config,
},
},
{
.gpio = 9, /* BLSP1 UART RX */
.settings = {
[GPIOMUX_SUSPENDED] = &gpio_uart_config,
},
},
{
.gpio = 10, /* BLSP1 QUP3 I2C_DAT */
.settings = {
[GPIOMUX_SUSPENDED] = &gpio_i2c_config,
},
},
{
.gpio = 11, /* BLSP1 QUP3 I2C_CLK */
.settings = {
[GPIOMUX_SUSPENDED] = &gpio_i2c_config,
},
},
{
.gpio = 61,
.settings = {
[GPIOMUX_ACTIVE] = &gpio_spi_cs_active_up_config,
[GPIOMUX_SUSPENDED] = &gpio_spi_cs_suspend_config,
},
},
};
/* [houjihai start] */
static struct gpiomux_setting key_active_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_8MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct gpiomux_setting key_suspend_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_8MA,
.pull = GPIOMUX_PULL_NONE,
};
/* [houjihai end] */
/* [houjihai start] gpio14 for wps key and gpio15 for reset*/
static struct msm_gpiomux_config mdm9625_key_configs[] __initdata = {
{
.gpio = 14,
.settings = {
[GPIOMUX_SUSPENDED] = &key_suspend_cfg,
[GPIOMUX_ACTIVE] = &key_active_cfg,
},
},
{
.gpio = 15,
.settings = {
[GPIOMUX_SUSPENDED] = &key_suspend_cfg,
[GPIOMUX_ACTIVE] = &key_active_cfg,
},
},
};
/* [houjihai end] */
static struct gpiomux_setting wlan_ath6kl_active_config = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
.dir = GPIOMUX_OUT_LOW,
};
static struct gpiomux_setting wlan_ath6kl_suspend_config = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
.dir = GPIOMUX_IN,
};
static struct msm_gpiomux_config wlan_ath6kl_configs[] __initdata = {
{
.gpio = 62,/* CHIP_PWD_L */
.settings = {
[GPIOMUX_ACTIVE] = &wlan_ath6kl_active_config,
[GPIOMUX_SUSPENDED] = &wlan_ath6kl_suspend_config,
},
},
};
static struct gpiomux_setting sdc2_card_det_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_DOWN,
.dir = GPIOMUX_IN,
};
struct msm_gpiomux_config sdc2_card_det_config[] __initdata = {
{
.gpio = 66,
.settings = {
[GPIOMUX_ACTIVE] = &sdc2_card_det_cfg,
[GPIOMUX_SUSPENDED] = &sdc2_card_det_cfg,
},
},
};
#ifdef CONFIG_OLED_S90319_PT
static struct msm_gpiomux_config msm9625_oled_s90319_configs[] __initdata = {
{
.gpio = 20,
.settings = {
[GPIOMUX_ACTIVE] = &gpio_spi_cs_active_up_config,
[GPIOMUX_SUSPENDED] = &gpio_spi_cs_suspend_config,
},
},
{
.gpio = 21,
.settings = {
[GPIOMUX_ACTIVE] = &gpio_spi_cs_active_config,
[GPIOMUX_SUSPENDED] = &gpio_spi_cs_config,
},
},
{
.gpio = 22,
.settings = {
[GPIOMUX_ACTIVE] = &gpio_spi_cs_active_up_config,
[GPIOMUX_SUSPENDED] = &gpio_spi_cs_suspend_config,
},
},
{
.gpio = 23,
.settings = {
[GPIOMUX_ACTIVE] = &gpio_spi_cs_active_up_config,
[GPIOMUX_SUSPENDED] = &gpio_spi_cs_suspend_config,
},
},
};
#endif
#ifdef CONFIG_FB_MSM_QPIC
static struct gpiomux_setting qpic_lcdc_a_d = {
.func = GPIOMUX_FUNC_1,
.drv = GPIOMUX_DRV_10MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct gpiomux_setting qpic_lcdc_cs = {
.func = GPIOMUX_FUNC_1,
.drv = GPIOMUX_DRV_10MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct gpiomux_setting qpic_lcdc_rs = {
.func = GPIOMUX_FUNC_1,
.drv = GPIOMUX_DRV_10MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct gpiomux_setting qpic_lcdc_te = {
.func = GPIOMUX_FUNC_7,
.drv = GPIOMUX_DRV_10MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct msm_gpiomux_config msm9625_qpic_lcdc_configs[] __initdata = {
{
.gpio = 20, /* a_d */
.settings = {
[GPIOMUX_SUSPENDED] = &qpic_lcdc_a_d,
},
},
{
.gpio = 21, /* cs */
.settings = {
[GPIOMUX_SUSPENDED] = &qpic_lcdc_cs,
},
},
{
.gpio = 22, /* te */
.settings = {
[GPIOMUX_SUSPENDED] = &qpic_lcdc_te,
},
},
{
.gpio = 23, /* rs */
.settings = {
[GPIOMUX_SUSPENDED] = &qpic_lcdc_rs,
},
},
};
static void msm9625_disp_init_gpiomux(void)
{
msm_gpiomux_install(msm9625_qpic_lcdc_configs,
ARRAY_SIZE(msm9625_qpic_lcdc_configs));
}
#else
static void msm9625_disp_init_gpiomux(void)
{
}
#endif /* CONFIG_FB_MSM_QPIC */
#ifdef CONFIG_MP2617_CHARGER
static struct gpiomux_setting mp2617_gpio_input_active_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
.dir = GPIOMUX_IN,
};
static struct gpiomux_setting mp2617_gpio_input_suspend_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
.dir = GPIOMUX_IN,
};
static struct gpiomux_setting mp2617_gpio_output_active_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct gpiomux_setting mp2617_gpio_output_suspend_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
};
/* refer to msm9625-mtp.dtsi */
static struct msm_gpiomux_config msm9625_mp2617_configs[] __initdata = {
{
.gpio = 13, /* Charge Enable, 1: Enable, 0: Disable */
.settings = {
[GPIOMUX_ACTIVE] = &mp2617_gpio_output_active_cfg,
[GPIOMUX_SUSPENDED] = &mp2617_gpio_output_suspend_cfg,
},
},
{
.gpio = 12, /* M0 */
.settings = {
[GPIOMUX_ACTIVE] = &mp2617_gpio_output_active_cfg,
[GPIOMUX_SUSPENDED] = &mp2617_gpio_output_suspend_cfg,
},
},
{
.gpio = 17, /* M1 */
.settings = {
[GPIOMUX_ACTIVE] = &mp2617_gpio_output_active_cfg,
[GPIOMUX_SUSPENDED] = &mp2617_gpio_output_suspend_cfg,
},
},
{
.gpio = 71, /* CHGOK, 0: Charging, 1: Complete */
.settings = {
[GPIOMUX_ACTIVE] = &mp2617_gpio_input_active_cfg,
[GPIOMUX_SUSPENDED] = &mp2617_gpio_input_suspend_cfg,
},
},
};
#endif
void __init msm9625_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));
msm_gpiomux_install(wlan_ath6kl_configs,
ARRAY_SIZE(wlan_ath6kl_configs));
/* [houjihai start] */
msm_gpiomux_install(mdm9625_key_configs,
ARRAY_SIZE(mdm9625_key_configs));
/* [houjihai end] */
msm_gpiomux_install(sdc2_card_det_config,
ARRAY_SIZE(sdc2_card_det_config));
msm9625_disp_init_gpiomux();
#ifdef CONFIG_OLED_S90319_PT
msm_gpiomux_install(msm9625_oled_s90319_configs,
ARRAY_SIZE(msm9625_oled_s90319_configs));
#endif
#ifdef CONFIG_MP2617_CHARGER
msm_gpiomux_install(msm9625_mp2617_configs,
ARRAY_SIZE(msm9625_mp2617_configs));
#endif
}

View File

@ -1,381 +0,0 @@
/* Copyright (c) 2012-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>
static struct gpiomux_setting gpio_uart_config = {
.func = GPIOMUX_FUNC_1,
.drv = GPIOMUX_DRV_8MA,
.pull = GPIOMUX_PULL_NONE,
.dir = GPIOMUX_OUT_HIGH,
};
static struct gpiomux_setting gpio_spi_cs_config = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_12MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct gpiomux_setting gpio_spi_cs_suspend_config = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_12MA,
.pull = GPIOMUX_PULL_UP,
};
static struct gpiomux_setting gpio_spi_cs_active_up_config = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_12MA,
.pull = GPIOMUX_PULL_UP,
};
static struct gpiomux_setting gpio_spi_config = {
.func = GPIOMUX_FUNC_1,
.drv = GPIOMUX_DRV_12MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct gpiomux_setting gpio_i2c_config = {
.func = GPIOMUX_FUNC_3,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct gpiomux_setting gpio_spi_cs_active_config = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_8MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct msm_gpiomux_config msm_blsp_configs[] __initdata = {
{
.gpio = 4, /* BLSP1 QUP2 SPI_DATA_MOSI */
.settings = {
[GPIOMUX_SUSPENDED] = &gpio_spi_config,
},
},
{
.gpio = 5, /* BLSP1 QUP2 SPI_DATA_MISO */
.settings = {
[GPIOMUX_SUSPENDED] = &gpio_spi_config,
},
},
{
.gpio = 6, /* BLSP1 QUP2 SPI_CS_N */
.settings = {
[GPIOMUX_ACTIVE] = &gpio_spi_cs_active_config,
[GPIOMUX_SUSPENDED] = &gpio_spi_cs_config,
},
},
{
.gpio = 7, /* BLSP1 QUP2 SPI_CLK */
.settings = {
[GPIOMUX_SUSPENDED] = &gpio_spi_config,
},
},
{
.gpio = 8, /* BLSP1 UART TX */
.settings = {
[GPIOMUX_SUSPENDED] = &gpio_uart_config,
},
},
{
.gpio = 9, /* BLSP1 UART RX */
.settings = {
[GPIOMUX_SUSPENDED] = &gpio_uart_config,
},
},
{
.gpio = 10, /* BLSP1 QUP3 I2C_DAT */
.settings = {
[GPIOMUX_SUSPENDED] = &gpio_i2c_config,
},
},
{
.gpio = 11, /* BLSP1 QUP3 I2C_CLK */
.settings = {
[GPIOMUX_SUSPENDED] = &gpio_i2c_config,
},
},
{
.gpio = 61,
.settings = {
[GPIOMUX_ACTIVE] = &gpio_spi_cs_active_up_config,
[GPIOMUX_SUSPENDED] = &gpio_spi_cs_suspend_config,
},
},
};
/* [houjihai start] */
static struct gpiomux_setting key_active_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_8MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct gpiomux_setting key_suspend_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_8MA,
.pull = GPIOMUX_PULL_NONE,
};
/* [houjihai end] */
/* [houjihai start] gpio14 for wps key and gpio15 for reset*/
static struct msm_gpiomux_config mdm9625_key_configs[] __initdata = {
{
.gpio = 14,
.settings = {
[GPIOMUX_SUSPENDED] = &key_suspend_cfg,
[GPIOMUX_ACTIVE] = &key_active_cfg,
},
},
{
.gpio = 15,
.settings = {
[GPIOMUX_SUSPENDED] = &key_suspend_cfg,
[GPIOMUX_ACTIVE] = &key_active_cfg,
},
},
};
/* [houjihai end] */
static struct gpiomux_setting wlan_ath6kl_active_config = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
.dir = GPIOMUX_OUT_LOW,
};
static struct gpiomux_setting wlan_ath6kl_suspend_config = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
.dir = GPIOMUX_IN,
};
static struct msm_gpiomux_config wlan_ath6kl_configs[] __initdata = {
{
.gpio = 62,/* CHIP_PWD_L */
.settings = {
[GPIOMUX_ACTIVE] = &wlan_ath6kl_active_config,
[GPIOMUX_SUSPENDED] = &wlan_ath6kl_suspend_config,
},
},
};
static struct gpiomux_setting sdc2_card_det_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_DOWN,
.dir = GPIOMUX_IN,
};
struct msm_gpiomux_config sdc2_card_det_config[] __initdata = {
{
.gpio = 66,
.settings = {
[GPIOMUX_ACTIVE] = &sdc2_card_det_cfg,
[GPIOMUX_SUSPENDED] = &sdc2_card_det_cfg,
},
},
};
#ifdef CONFIG_OLED_S90319_PT
static struct msm_gpiomux_config msm9625_oled_s90319_configs[] __initdata = {
{
.gpio = 20,
.settings = {
[GPIOMUX_ACTIVE] = &gpio_spi_cs_active_up_config,
[GPIOMUX_SUSPENDED] = &gpio_spi_cs_suspend_config,
},
},
{
.gpio = 21,
.settings = {
[GPIOMUX_ACTIVE] = &gpio_spi_cs_active_config,
[GPIOMUX_SUSPENDED] = &gpio_spi_cs_config,
},
},
{
.gpio = 22,
.settings = {
[GPIOMUX_ACTIVE] = &gpio_spi_cs_active_up_config,
[GPIOMUX_SUSPENDED] = &gpio_spi_cs_suspend_config,
},
},
{
.gpio = 23,
.settings = {
[GPIOMUX_ACTIVE] = &gpio_spi_cs_active_up_config,
[GPIOMUX_SUSPENDED] = &gpio_spi_cs_suspend_config,
},
},
};
#endif
#ifdef CONFIG_FB_MSM_QPIC
static struct gpiomux_setting qpic_lcdc_a_d = {
.func = GPIOMUX_FUNC_1,
.drv = GPIOMUX_DRV_10MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct gpiomux_setting qpic_lcdc_cs = {
.func = GPIOMUX_FUNC_1,
.drv = GPIOMUX_DRV_10MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct gpiomux_setting qpic_lcdc_rs = {
.func = GPIOMUX_FUNC_1,
.drv = GPIOMUX_DRV_10MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct gpiomux_setting qpic_lcdc_te = {
.func = GPIOMUX_FUNC_7,
.drv = GPIOMUX_DRV_10MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct msm_gpiomux_config msm9625_qpic_lcdc_configs[] __initdata = {
{
.gpio = 20, /* a_d */
.settings = {
[GPIOMUX_SUSPENDED] = &qpic_lcdc_a_d,
},
},
{
.gpio = 21, /* cs */
.settings = {
[GPIOMUX_SUSPENDED] = &qpic_lcdc_cs,
},
},
{
.gpio = 22, /* te */
.settings = {
[GPIOMUX_SUSPENDED] = &qpic_lcdc_te,
},
},
{
.gpio = 23, /* rs */
.settings = {
[GPIOMUX_SUSPENDED] = &qpic_lcdc_rs,
},
},
};
static void msm9625_disp_init_gpiomux(void)
{
msm_gpiomux_install(msm9625_qpic_lcdc_configs,
ARRAY_SIZE(msm9625_qpic_lcdc_configs));
}
#else
static void msm9625_disp_init_gpiomux(void)
{
}
#endif /* CONFIG_FB_MSM_QPIC */
#ifdef CONFIG_MP2617_CHARGER
static struct gpiomux_setting mp2617_gpio_input_active_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
.dir = GPIOMUX_IN,
};
static struct gpiomux_setting mp2617_gpio_input_suspend_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
.dir = GPIOMUX_IN,
};
static struct gpiomux_setting mp2617_gpio_output_active_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct gpiomux_setting mp2617_gpio_output_suspend_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
};
/* refer to msm9625-mtp.dtsi */
static struct msm_gpiomux_config msm9625_mp2617_configs[] __initdata = {
{
.gpio = 13, /* Charge Enable, 1: Enable, 0: Disable */
.settings = {
[GPIOMUX_ACTIVE] = &mp2617_gpio_output_active_cfg,
[GPIOMUX_SUSPENDED] = &mp2617_gpio_output_suspend_cfg,
},
},
{
.gpio = 12, /* M0 */
.settings = {
[GPIOMUX_ACTIVE] = &mp2617_gpio_output_active_cfg,
[GPIOMUX_SUSPENDED] = &mp2617_gpio_output_suspend_cfg,
},
},
{
.gpio = 17, /* M1 */
.settings = {
[GPIOMUX_ACTIVE] = &mp2617_gpio_output_active_cfg,
[GPIOMUX_SUSPENDED] = &mp2617_gpio_output_suspend_cfg,
},
},
{
.gpio = 71, /* CHGOK, 0: Charging, 1: Complete */
.settings = {
[GPIOMUX_ACTIVE] = &mp2617_gpio_input_active_cfg,
[GPIOMUX_SUSPENDED] = &mp2617_gpio_input_suspend_cfg,
},
},
};
#endif
void __init msm9625_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));
msm_gpiomux_install(wlan_ath6kl_configs,
ARRAY_SIZE(wlan_ath6kl_configs));
/* [houjihai start] */
msm_gpiomux_install(mdm9625_key_configs,
ARRAY_SIZE(mdm9625_key_configs));
/* [houjihai end] */
msm_gpiomux_install(sdc2_card_det_config,
ARRAY_SIZE(sdc2_card_det_config));
msm9625_disp_init_gpiomux();
#ifdef CONFIG_OLED_S90319_PT
msm_gpiomux_install(msm9625_oled_s90319_configs,
ARRAY_SIZE(msm9625_oled_s90319_configs));
#endif
#ifdef CONFIG_MP2617_CHARGER
msm_gpiomux_install(msm9625_mp2617_configs,
ARRAY_SIZE(msm9625_mp2617_configs));
#endif
}

View File

@ -1,381 +0,0 @@
/* Copyright (c) 2012-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>
static struct gpiomux_setting gpio_uart_config = {
.func = GPIOMUX_FUNC_1,
.drv = GPIOMUX_DRV_8MA,
.pull = GPIOMUX_PULL_NONE,
.dir = GPIOMUX_OUT_HIGH,
};
static struct gpiomux_setting gpio_spi_cs_config = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_12MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct gpiomux_setting gpio_spi_cs_suspend_config = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_12MA,
.pull = GPIOMUX_PULL_UP,
};
static struct gpiomux_setting gpio_spi_cs_active_up_config = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_12MA,
.pull = GPIOMUX_PULL_UP,
};
static struct gpiomux_setting gpio_spi_config = {
.func = GPIOMUX_FUNC_1,
.drv = GPIOMUX_DRV_12MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct gpiomux_setting gpio_i2c_config = {
.func = GPIOMUX_FUNC_3,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct gpiomux_setting gpio_spi_cs_active_config = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_8MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct msm_gpiomux_config msm_blsp_configs[] __initdata = {
{
.gpio = 4, /* BLSP1 QUP2 SPI_DATA_MOSI */
.settings = {
[GPIOMUX_SUSPENDED] = &gpio_spi_config,
},
},
{
.gpio = 5, /* BLSP1 QUP2 SPI_DATA_MISO */
.settings = {
[GPIOMUX_SUSPENDED] = &gpio_spi_config,
},
},
{
.gpio = 6, /* BLSP1 QUP2 SPI_CS_N */
.settings = {
[GPIOMUX_ACTIVE] = &gpio_spi_cs_active_config,
[GPIOMUX_SUSPENDED] = &gpio_spi_cs_config,
},
},
{
.gpio = 7, /* BLSP1 QUP2 SPI_CLK */
.settings = {
[GPIOMUX_SUSPENDED] = &gpio_spi_config,
},
},
{
.gpio = 8, /* BLSP1 UART TX */
.settings = {
[GPIOMUX_SUSPENDED] = &gpio_uart_config,
},
},
{
.gpio = 9, /* BLSP1 UART RX */
.settings = {
[GPIOMUX_SUSPENDED] = &gpio_uart_config,
},
},
{
.gpio = 10, /* BLSP1 QUP3 I2C_DAT */
.settings = {
[GPIOMUX_SUSPENDED] = &gpio_i2c_config,
},
},
{
.gpio = 11, /* BLSP1 QUP3 I2C_CLK */
.settings = {
[GPIOMUX_SUSPENDED] = &gpio_i2c_config,
},
},
{
.gpio = 61,
.settings = {
[GPIOMUX_ACTIVE] = &gpio_spi_cs_active_up_config,
[GPIOMUX_SUSPENDED] = &gpio_spi_cs_suspend_config,
},
},
};
/* [houjihai start] */
static struct gpiomux_setting key_active_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_8MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct gpiomux_setting key_suspend_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_8MA,
.pull = GPIOMUX_PULL_NONE,
};
/* [houjihai end] */
/* [houjihai start] gpio14 for wps key and gpio15 for reset*/
static struct msm_gpiomux_config mdm9625_key_configs[] __initdata = {
{
.gpio = 14,
.settings = {
[GPIOMUX_SUSPENDED] = &key_suspend_cfg,
[GPIOMUX_ACTIVE] = &key_active_cfg,
},
},
{
.gpio = 15,
.settings = {
[GPIOMUX_SUSPENDED] = &key_suspend_cfg,
[GPIOMUX_ACTIVE] = &key_active_cfg,
},
},
};
/* [houjihai end] */
static struct gpiomux_setting wlan_ath6kl_active_config = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
.dir = GPIOMUX_OUT_LOW,
};
static struct gpiomux_setting wlan_ath6kl_suspend_config = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
.dir = GPIOMUX_IN,
};
static struct msm_gpiomux_config wlan_ath6kl_configs[] __initdata = {
{
.gpio = 62,/* CHIP_PWD_L */
.settings = {
[GPIOMUX_ACTIVE] = &wlan_ath6kl_active_config,
[GPIOMUX_SUSPENDED] = &wlan_ath6kl_suspend_config,
},
},
};
static struct gpiomux_setting sdc2_card_det_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_DOWN,
.dir = GPIOMUX_IN,
};
struct msm_gpiomux_config sdc2_card_det_config[] __initdata = {
{
.gpio = 66,
.settings = {
[GPIOMUX_ACTIVE] = &sdc2_card_det_cfg,
[GPIOMUX_SUSPENDED] = &sdc2_card_det_cfg,
},
},
};
#ifdef CONFIG_OLED_S90319_PT
static struct msm_gpiomux_config msm9625_oled_s90319_configs[] __initdata = {
{
.gpio = 20,
.settings = {
[GPIOMUX_ACTIVE] = &gpio_spi_cs_active_up_config,
[GPIOMUX_SUSPENDED] = &gpio_spi_cs_suspend_config,
},
},
{
.gpio = 21,
.settings = {
[GPIOMUX_ACTIVE] = &gpio_spi_cs_active_config,
[GPIOMUX_SUSPENDED] = &gpio_spi_cs_config,
},
},
{
.gpio = 22,
.settings = {
[GPIOMUX_ACTIVE] = &gpio_spi_cs_active_up_config,
[GPIOMUX_SUSPENDED] = &gpio_spi_cs_suspend_config,
},
},
{
.gpio = 23,
.settings = {
[GPIOMUX_ACTIVE] = &gpio_spi_cs_active_up_config,
[GPIOMUX_SUSPENDED] = &gpio_spi_cs_suspend_config,
},
},
};
#endif
#ifdef CONFIG_FB_MSM_QPIC
static struct gpiomux_setting qpic_lcdc_a_d = {
.func = GPIOMUX_FUNC_1,
.drv = GPIOMUX_DRV_10MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct gpiomux_setting qpic_lcdc_cs = {
.func = GPIOMUX_FUNC_1,
.drv = GPIOMUX_DRV_10MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct gpiomux_setting qpic_lcdc_rs = {
.func = GPIOMUX_FUNC_1,
.drv = GPIOMUX_DRV_10MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct gpiomux_setting qpic_lcdc_te = {
.func = GPIOMUX_FUNC_7,
.drv = GPIOMUX_DRV_10MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct msm_gpiomux_config msm9625_qpic_lcdc_configs[] __initdata = {
{
.gpio = 20, /* a_d */
.settings = {
[GPIOMUX_SUSPENDED] = &qpic_lcdc_a_d,
},
},
{
.gpio = 21, /* cs */
.settings = {
[GPIOMUX_SUSPENDED] = &qpic_lcdc_cs,
},
},
{
.gpio = 22, /* te */
.settings = {
[GPIOMUX_SUSPENDED] = &qpic_lcdc_te,
},
},
{
.gpio = 23, /* rs */
.settings = {
[GPIOMUX_SUSPENDED] = &qpic_lcdc_rs,
},
},
};
static void msm9625_disp_init_gpiomux(void)
{
msm_gpiomux_install(msm9625_qpic_lcdc_configs,
ARRAY_SIZE(msm9625_qpic_lcdc_configs));
}
#else
static void msm9625_disp_init_gpiomux(void)
{
}
#endif /* CONFIG_FB_MSM_QPIC */
#ifdef CONFIG_MP2617_CHARGER
static struct gpiomux_setting mp2617_gpio_input_active_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
.dir = GPIOMUX_IN,
};
static struct gpiomux_setting mp2617_gpio_input_suspend_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
.dir = GPIOMUX_IN,
};
static struct gpiomux_setting mp2617_gpio_output_active_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct gpiomux_setting mp2617_gpio_output_suspend_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
};
/* refer to msm9625-mtp.dtsi */
static struct msm_gpiomux_config msm9625_mp2617_configs[] __initdata = {
{
.gpio = 13, /* Charge Enable, 1: Enable, 0: Disable */
.settings = {
[GPIOMUX_ACTIVE] = &mp2617_gpio_output_active_cfg,
[GPIOMUX_SUSPENDED] = &mp2617_gpio_output_suspend_cfg,
},
},
{
.gpio = 12, /* M0 */
.settings = {
[GPIOMUX_ACTIVE] = &mp2617_gpio_output_active_cfg,
[GPIOMUX_SUSPENDED] = &mp2617_gpio_output_suspend_cfg,
},
},
{
.gpio = 17, /* M1 */
.settings = {
[GPIOMUX_ACTIVE] = &mp2617_gpio_output_active_cfg,
[GPIOMUX_SUSPENDED] = &mp2617_gpio_output_suspend_cfg,
},
},
{
.gpio = 71, /* CHGOK, 0: Charging, 1: Complete */
.settings = {
[GPIOMUX_ACTIVE] = &mp2617_gpio_input_active_cfg,
[GPIOMUX_SUSPENDED] = &mp2617_gpio_input_suspend_cfg,
},
},
};
#endif
void __init msm9625_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));
msm_gpiomux_install(wlan_ath6kl_configs,
ARRAY_SIZE(wlan_ath6kl_configs));
/* [houjihai start] */
msm_gpiomux_install(mdm9625_key_configs,
ARRAY_SIZE(mdm9625_key_configs));
/* [houjihai end] */
msm_gpiomux_install(sdc2_card_det_config,
ARRAY_SIZE(sdc2_card_det_config));
msm9625_disp_init_gpiomux();
#ifdef CONFIG_OLED_S90319_PT
msm_gpiomux_install(msm9625_oled_s90319_configs,
ARRAY_SIZE(msm9625_oled_s90319_configs));
#endif
#ifdef CONFIG_MP2617_CHARGER
msm_gpiomux_install(msm9625_mp2617_configs,
ARRAY_SIZE(msm9625_mp2617_configs));
#endif
}

View File

@ -1,381 +0,0 @@
/* Copyright (c) 2012-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>
static struct gpiomux_setting gpio_uart_config = {
.func = GPIOMUX_FUNC_1,
.drv = GPIOMUX_DRV_8MA,
.pull = GPIOMUX_PULL_NONE,
.dir = GPIOMUX_OUT_HIGH,
};
static struct gpiomux_setting gpio_spi_cs_config = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_12MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct gpiomux_setting gpio_spi_cs_suspend_config = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_12MA,
.pull = GPIOMUX_PULL_UP,
};
static struct gpiomux_setting gpio_spi_cs_active_up_config = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_12MA,
.pull = GPIOMUX_PULL_UP,
};
static struct gpiomux_setting gpio_spi_config = {
.func = GPIOMUX_FUNC_1,
.drv = GPIOMUX_DRV_12MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct gpiomux_setting gpio_i2c_config = {
.func = GPIOMUX_FUNC_3,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct gpiomux_setting gpio_spi_cs_active_config = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_8MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct msm_gpiomux_config msm_blsp_configs[] __initdata = {
{
.gpio = 4, /* BLSP1 QUP2 SPI_DATA_MOSI */
.settings = {
[GPIOMUX_SUSPENDED] = &gpio_spi_config,
},
},
{
.gpio = 5, /* BLSP1 QUP2 SPI_DATA_MISO */
.settings = {
[GPIOMUX_SUSPENDED] = &gpio_spi_config,
},
},
{
.gpio = 6, /* BLSP1 QUP2 SPI_CS_N */
.settings = {
[GPIOMUX_ACTIVE] = &gpio_spi_cs_active_config,
[GPIOMUX_SUSPENDED] = &gpio_spi_cs_config,
},
},
{
.gpio = 7, /* BLSP1 QUP2 SPI_CLK */
.settings = {
[GPIOMUX_SUSPENDED] = &gpio_spi_config,
},
},
{
.gpio = 8, /* BLSP1 UART TX */
.settings = {
[GPIOMUX_SUSPENDED] = &gpio_uart_config,
},
},
{
.gpio = 9, /* BLSP1 UART RX */
.settings = {
[GPIOMUX_SUSPENDED] = &gpio_uart_config,
},
},
{
.gpio = 10, /* BLSP1 QUP3 I2C_DAT */
.settings = {
[GPIOMUX_SUSPENDED] = &gpio_i2c_config,
},
},
{
.gpio = 11, /* BLSP1 QUP3 I2C_CLK */
.settings = {
[GPIOMUX_SUSPENDED] = &gpio_i2c_config,
},
},
{
.gpio = 61,
.settings = {
[GPIOMUX_ACTIVE] = &gpio_spi_cs_active_up_config,
[GPIOMUX_SUSPENDED] = &gpio_spi_cs_suspend_config,
},
},
};
/* [houjihai start] */
static struct gpiomux_setting key_active_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_8MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct gpiomux_setting key_suspend_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_8MA,
.pull = GPIOMUX_PULL_NONE,
};
/* [houjihai end] */
/* [houjihai start] gpio14 for wps key and gpio15 for reset*/
static struct msm_gpiomux_config mdm9625_key_configs[] __initdata = {
{
.gpio = 14,
.settings = {
[GPIOMUX_SUSPENDED] = &key_suspend_cfg,
[GPIOMUX_ACTIVE] = &key_active_cfg,
},
},
{
.gpio = 15,
.settings = {
[GPIOMUX_SUSPENDED] = &key_suspend_cfg,
[GPIOMUX_ACTIVE] = &key_active_cfg,
},
},
};
/* [houjihai end] */
static struct gpiomux_setting wlan_ath6kl_active_config = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
.dir = GPIOMUX_OUT_LOW,
};
static struct gpiomux_setting wlan_ath6kl_suspend_config = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
.dir = GPIOMUX_IN,
};
static struct msm_gpiomux_config wlan_ath6kl_configs[] __initdata = {
{
.gpio = 62,/* CHIP_PWD_L */
.settings = {
[GPIOMUX_ACTIVE] = &wlan_ath6kl_active_config,
[GPIOMUX_SUSPENDED] = &wlan_ath6kl_suspend_config,
},
},
};
static struct gpiomux_setting sdc2_card_det_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_DOWN,
.dir = GPIOMUX_IN,
};
struct msm_gpiomux_config sdc2_card_det_config[] __initdata = {
{
.gpio = 66,
.settings = {
[GPIOMUX_ACTIVE] = &sdc2_card_det_cfg,
[GPIOMUX_SUSPENDED] = &sdc2_card_det_cfg,
},
},
};
#ifdef CONFIG_OLED_S90319_PT
static struct msm_gpiomux_config msm9625_oled_s90319_configs[] __initdata = {
{
.gpio = 20,
.settings = {
[GPIOMUX_ACTIVE] = &gpio_spi_cs_active_up_config,
[GPIOMUX_SUSPENDED] = &gpio_spi_cs_suspend_config,
},
},
{
.gpio = 21,
.settings = {
[GPIOMUX_ACTIVE] = &gpio_spi_cs_active_config,
[GPIOMUX_SUSPENDED] = &gpio_spi_cs_config,
},
},
{
.gpio = 22,
.settings = {
[GPIOMUX_ACTIVE] = &gpio_spi_cs_active_up_config,
[GPIOMUX_SUSPENDED] = &gpio_spi_cs_suspend_config,
},
},
{
.gpio = 23,
.settings = {
[GPIOMUX_ACTIVE] = &gpio_spi_cs_active_up_config,
[GPIOMUX_SUSPENDED] = &gpio_spi_cs_suspend_config,
},
},
};
#endif
#ifdef CONFIG_FB_MSM_QPIC
static struct gpiomux_setting qpic_lcdc_a_d = {
.func = GPIOMUX_FUNC_1,
.drv = GPIOMUX_DRV_10MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct gpiomux_setting qpic_lcdc_cs = {
.func = GPIOMUX_FUNC_1,
.drv = GPIOMUX_DRV_10MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct gpiomux_setting qpic_lcdc_rs = {
.func = GPIOMUX_FUNC_1,
.drv = GPIOMUX_DRV_10MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct gpiomux_setting qpic_lcdc_te = {
.func = GPIOMUX_FUNC_7,
.drv = GPIOMUX_DRV_10MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct msm_gpiomux_config msm9625_qpic_lcdc_configs[] __initdata = {
{
.gpio = 20, /* a_d */
.settings = {
[GPIOMUX_SUSPENDED] = &qpic_lcdc_a_d,
},
},
{
.gpio = 21, /* cs */
.settings = {
[GPIOMUX_SUSPENDED] = &qpic_lcdc_cs,
},
},
{
.gpio = 22, /* te */
.settings = {
[GPIOMUX_SUSPENDED] = &qpic_lcdc_te,
},
},
{
.gpio = 23, /* rs */
.settings = {
[GPIOMUX_SUSPENDED] = &qpic_lcdc_rs,
},
},
};
static void msm9625_disp_init_gpiomux(void)
{
msm_gpiomux_install(msm9625_qpic_lcdc_configs,
ARRAY_SIZE(msm9625_qpic_lcdc_configs));
}
#else
static void msm9625_disp_init_gpiomux(void)
{
}
#endif /* CONFIG_FB_MSM_QPIC */
#ifdef CONFIG_MP2617_CHARGER
static struct gpiomux_setting mp2617_gpio_input_active_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
.dir = GPIOMUX_IN,
};
static struct gpiomux_setting mp2617_gpio_input_suspend_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
.dir = GPIOMUX_IN,
};
static struct gpiomux_setting mp2617_gpio_output_active_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct gpiomux_setting mp2617_gpio_output_suspend_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
};
/* refer to msm9625-mtp.dtsi */
static struct msm_gpiomux_config msm9625_mp2617_configs[] __initdata = {
{
.gpio = 13, /* Charge Enable, 1: Enable, 0: Disable */
.settings = {
[GPIOMUX_ACTIVE] = &mp2617_gpio_output_active_cfg,
[GPIOMUX_SUSPENDED] = &mp2617_gpio_output_suspend_cfg,
},
},
{
.gpio = 12, /* M0 */
.settings = {
[GPIOMUX_ACTIVE] = &mp2617_gpio_output_active_cfg,
[GPIOMUX_SUSPENDED] = &mp2617_gpio_output_suspend_cfg,
},
},
{
.gpio = 17, /* M1 */
.settings = {
[GPIOMUX_ACTIVE] = &mp2617_gpio_output_active_cfg,
[GPIOMUX_SUSPENDED] = &mp2617_gpio_output_suspend_cfg,
},
},
{
.gpio = 71, /* CHGOK, 0: Charging, 1: Complete */
.settings = {
[GPIOMUX_ACTIVE] = &mp2617_gpio_input_active_cfg,
[GPIOMUX_SUSPENDED] = &mp2617_gpio_input_suspend_cfg,
},
},
};
#endif
void __init msm9625_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));
msm_gpiomux_install(wlan_ath6kl_configs,
ARRAY_SIZE(wlan_ath6kl_configs));
/* [houjihai start] */
msm_gpiomux_install(mdm9625_key_configs,
ARRAY_SIZE(mdm9625_key_configs));
/* [houjihai end] */
msm_gpiomux_install(sdc2_card_det_config,
ARRAY_SIZE(sdc2_card_det_config));
msm9625_disp_init_gpiomux();
#ifdef CONFIG_OLED_S90319_PT
msm_gpiomux_install(msm9625_oled_s90319_configs,
ARRAY_SIZE(msm9625_oled_s90319_configs));
#endif
#ifdef CONFIG_MP2617_CHARGER
msm_gpiomux_install(msm9625_mp2617_configs,
ARRAY_SIZE(msm9625_mp2617_configs));
#endif
}

View File

@ -1,354 +0,0 @@
/* Copyright (c) 2012-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>
static struct gpiomux_setting gpio_uart_config = {
.func = GPIOMUX_FUNC_1,
.drv = GPIOMUX_DRV_8MA,
.pull = GPIOMUX_PULL_NONE,
.dir = GPIOMUX_OUT_HIGH,
};
static struct gpiomux_setting gpio_i2c_config = {
.func = GPIOMUX_FUNC_3,
.drv = GPIOMUX_DRV_2MA,
.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 = 10, /* BLSP1 QUP3 I2C_DAT */
.settings = {
[GPIOMUX_SUSPENDED] = &gpio_i2c_config,
},
},
{
.gpio = 11, /* BLSP1 QUP3 I2C_CLK */
.settings = {
[GPIOMUX_SUSPENDED] = &gpio_i2c_config,
},
},
};
/* [houjihai start] */
static struct gpiomux_setting key_active_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_8MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct gpiomux_setting key_suspend_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_8MA,
.pull = GPIOMUX_PULL_NONE,
};
/* [houjihai end] */
/* [houjihai start] gpio14 for wps key and gpio15 for reset*/
static struct msm_gpiomux_config mdm9625_key_configs[] __initdata = {
{
.gpio = 15,
.settings = {
[GPIOMUX_SUSPENDED] = &key_suspend_cfg,
[GPIOMUX_ACTIVE] = &key_active_cfg,
},
},
};
/* [houjihai end] */
static struct gpiomux_setting wlan_ath6kl_active_config = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
.dir = GPIOMUX_OUT_LOW,
};
static struct gpiomux_setting wlan_ath6kl_suspend_config = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
.dir = GPIOMUX_IN,
};
static struct msm_gpiomux_config wlan_ath6kl_configs[] __initdata = {
{
.gpio = 62,/* CHIP_PWD_L */
.settings = {
[GPIOMUX_ACTIVE] = &wlan_ath6kl_active_config,
[GPIOMUX_SUSPENDED] = &wlan_ath6kl_suspend_config,
},
},
};
static struct gpiomux_setting sdc2_card_det_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_DOWN,
.dir = GPIOMUX_IN,
};
struct msm_gpiomux_config sdc2_card_det_config[] __initdata = {
{
.gpio = 66,
.settings = {
[GPIOMUX_ACTIVE] = &sdc2_card_det_cfg,
[GPIOMUX_SUSPENDED] = &sdc2_card_det_cfg,
},
},
};
#ifdef CONFIG_FB_MSM_QPIC
static struct gpiomux_setting qpic_lcdc_a_d = {
.func = GPIOMUX_FUNC_1,
.drv = GPIOMUX_DRV_10MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct gpiomux_setting qpic_lcdc_cs = {
.func = GPIOMUX_FUNC_1,
.drv = GPIOMUX_DRV_10MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct gpiomux_setting qpic_lcdc_rs = {
.func = GPIOMUX_FUNC_1,
.drv = GPIOMUX_DRV_10MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct gpiomux_setting qpic_lcdc_te = {
.func = GPIOMUX_FUNC_7,
.drv = GPIOMUX_DRV_10MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct msm_gpiomux_config msm9625_qpic_lcdc_configs[] __initdata = {
{
.gpio = 20, /* a_d */
.settings = {
[GPIOMUX_SUSPENDED] = &qpic_lcdc_a_d,
},
},
{
.gpio = 21, /* cs */
.settings = {
[GPIOMUX_SUSPENDED] = &qpic_lcdc_cs,
},
},
{
.gpio = 22, /* te */
.settings = {
[GPIOMUX_SUSPENDED] = &qpic_lcdc_te,
},
},
{
.gpio = 23, /* rs */
.settings = {
[GPIOMUX_SUSPENDED] = &qpic_lcdc_rs,
},
},
};
static void msm9625_disp_init_gpiomux(void)
{
msm_gpiomux_install(msm9625_qpic_lcdc_configs,
ARRAY_SIZE(msm9625_qpic_lcdc_configs));
}
#else
static void msm9625_disp_init_gpiomux(void)
{
}
#endif /* CONFIG_FB_MSM_QPIC */
#ifdef CONFIG_MP2617_CHARGER
static struct gpiomux_setting mp2617_gpio_input_active_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
.dir = GPIOMUX_IN,
};
static struct gpiomux_setting mp2617_gpio_input_suspend_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
.dir = GPIOMUX_IN,
};
static struct gpiomux_setting mp2617_gpio_output_active_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct gpiomux_setting mp2617_gpio_output_suspend_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
};
/* refer to msm9625-mtp.dtsi */
static struct msm_gpiomux_config msm9625_mp2617_configs[] __initdata = {
{
.gpio = 13, /* Charge Enable, 1: Enable, 0: Disable */
.settings = {
[GPIOMUX_ACTIVE] = &mp2617_gpio_output_active_cfg,
[GPIOMUX_SUSPENDED] = &mp2617_gpio_output_suspend_cfg,
},
},
{
.gpio = 16, /* M0 */
.settings = {
[GPIOMUX_ACTIVE] = &mp2617_gpio_output_active_cfg,
[GPIOMUX_SUSPENDED] = &mp2617_gpio_output_suspend_cfg,
},
},
{
.gpio = 17, /* M1 */
.settings = {
[GPIOMUX_ACTIVE] = &mp2617_gpio_output_active_cfg,
[GPIOMUX_SUSPENDED] = &mp2617_gpio_output_suspend_cfg,
},
},
{
.gpio = 70, /* CHGOK, 0: Charging, 1: Complete */
.settings = {
[GPIOMUX_ACTIVE] = &mp2617_gpio_input_active_cfg,
[GPIOMUX_SUSPENDED] = &mp2617_gpio_input_suspend_cfg,
},
},
#ifdef CONFIG_POWER_BANK_DETECT_SUPPORT
{
.gpio = 14, /* Boost_EN, 0: Disbale, 1: Enable */
.settings = {
[GPIOMUX_ACTIVE] = &mp2617_gpio_output_active_cfg,
[GPIOMUX_SUSPENDED] = &mp2617_gpio_output_suspend_cfg,
},
},
#endif
};
#endif
#ifdef CONFIG_OLED_SSD1306_PT
static struct gpiomux_setting oled_ssd1306_gpio_active_config = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_UP,
.dir = GPIOMUX_OUT_HIGH,
};
static struct gpiomux_setting oled_ssd1306_gpio_suspend_config = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct gpiomux_setting oled_ssd1306_gpio_cs_config = {
.func = GPIOMUX_FUNC_1,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct msm_gpiomux_config msm9625_oled_ssd1306_configs[] __initdata = {
{
.gpio = 4, /* oled ssd1306 chip select */
.settings = {
[GPIOMUX_SUSPENDED] = &oled_ssd1306_gpio_suspend_config,
[GPIOMUX_ACTIVE] = &oled_ssd1306_gpio_active_config,
},
},
{
.gpio = 5, /* oled ssd1306 a0 */
.settings = {
[GPIOMUX_SUSPENDED] = &oled_ssd1306_gpio_suspend_config,
[GPIOMUX_ACTIVE] = &oled_ssd1306_gpio_active_config,
},
},
{
.gpio = 6, /* oled ssd1306 reset */
.settings = {
[GPIOMUX_SUSPENDED] = &oled_ssd1306_gpio_cs_config,
[GPIOMUX_ACTIVE] = &oled_ssd1306_gpio_active_config,
},
},
{
.gpio = 7, /* oled ssd1306 boost enable */
.settings = {
[GPIOMUX_SUSPENDED] = &oled_ssd1306_gpio_suspend_config,
[GPIOMUX_ACTIVE] = &oled_ssd1306_gpio_active_config,
},
},
{
.gpio = 10, /* oled ssd1306 I2C_DAT */
.settings = {
[GPIOMUX_SUSPENDED] = &gpio_i2c_config,
},
},
{
.gpio = 11, /* oled ssd1306 I2C_CLK */
.settings = {
[GPIOMUX_SUSPENDED] = &gpio_i2c_config,
},
},
};
#endif
void __init msm9625_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));
msm_gpiomux_install(wlan_ath6kl_configs,
ARRAY_SIZE(wlan_ath6kl_configs));
/* [houjihai start] */
msm_gpiomux_install(mdm9625_key_configs,
ARRAY_SIZE(mdm9625_key_configs));
/* [houjihai end] */
msm_gpiomux_install(sdc2_card_det_config,
ARRAY_SIZE(sdc2_card_det_config));
msm9625_disp_init_gpiomux();
#ifdef CONFIG_MP2617_CHARGER
msm_gpiomux_install(msm9625_mp2617_configs,
ARRAY_SIZE(msm9625_mp2617_configs));
#endif
#ifdef CONFIG_OLED_SSD1306_PT
msm_gpiomux_install(msm9625_oled_ssd1306_configs,
ARRAY_SIZE(msm9625_oled_ssd1306_configs));
#endif
}

View File

@ -1,354 +0,0 @@
/* Copyright (c) 2012-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>
static struct gpiomux_setting gpio_uart_config = {
.func = GPIOMUX_FUNC_1,
.drv = GPIOMUX_DRV_8MA,
.pull = GPIOMUX_PULL_NONE,
.dir = GPIOMUX_OUT_HIGH,
};
static struct gpiomux_setting gpio_i2c_config = {
.func = GPIOMUX_FUNC_3,
.drv = GPIOMUX_DRV_2MA,
.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 = 10, /* BLSP1 QUP3 I2C_DAT */
.settings = {
[GPIOMUX_SUSPENDED] = &gpio_i2c_config,
},
},
{
.gpio = 11, /* BLSP1 QUP3 I2C_CLK */
.settings = {
[GPIOMUX_SUSPENDED] = &gpio_i2c_config,
},
},
};
/* [houjihai start] */
static struct gpiomux_setting key_active_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_8MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct gpiomux_setting key_suspend_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_8MA,
.pull = GPIOMUX_PULL_NONE,
};
/* [houjihai end] */
/* [houjihai start] gpio14 for wps key and gpio15 for reset*/
static struct msm_gpiomux_config mdm9625_key_configs[] __initdata = {
{
.gpio = 15,
.settings = {
[GPIOMUX_SUSPENDED] = &key_suspend_cfg,
[GPIOMUX_ACTIVE] = &key_active_cfg,
},
},
};
/* [houjihai end] */
static struct gpiomux_setting wlan_ath6kl_active_config = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
.dir = GPIOMUX_OUT_LOW,
};
static struct gpiomux_setting wlan_ath6kl_suspend_config = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
.dir = GPIOMUX_IN,
};
static struct msm_gpiomux_config wlan_ath6kl_configs[] __initdata = {
{
.gpio = 62,/* CHIP_PWD_L */
.settings = {
[GPIOMUX_ACTIVE] = &wlan_ath6kl_active_config,
[GPIOMUX_SUSPENDED] = &wlan_ath6kl_suspend_config,
},
},
};
static struct gpiomux_setting sdc2_card_det_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_DOWN,
.dir = GPIOMUX_IN,
};
struct msm_gpiomux_config sdc2_card_det_config[] __initdata = {
{
.gpio = 66,
.settings = {
[GPIOMUX_ACTIVE] = &sdc2_card_det_cfg,
[GPIOMUX_SUSPENDED] = &sdc2_card_det_cfg,
},
},
};
#ifdef CONFIG_FB_MSM_QPIC
static struct gpiomux_setting qpic_lcdc_a_d = {
.func = GPIOMUX_FUNC_1,
.drv = GPIOMUX_DRV_10MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct gpiomux_setting qpic_lcdc_cs = {
.func = GPIOMUX_FUNC_1,
.drv = GPIOMUX_DRV_10MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct gpiomux_setting qpic_lcdc_rs = {
.func = GPIOMUX_FUNC_1,
.drv = GPIOMUX_DRV_10MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct gpiomux_setting qpic_lcdc_te = {
.func = GPIOMUX_FUNC_7,
.drv = GPIOMUX_DRV_10MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct msm_gpiomux_config msm9625_qpic_lcdc_configs[] __initdata = {
{
.gpio = 20, /* a_d */
.settings = {
[GPIOMUX_SUSPENDED] = &qpic_lcdc_a_d,
},
},
{
.gpio = 21, /* cs */
.settings = {
[GPIOMUX_SUSPENDED] = &qpic_lcdc_cs,
},
},
{
.gpio = 22, /* te */
.settings = {
[GPIOMUX_SUSPENDED] = &qpic_lcdc_te,
},
},
{
.gpio = 23, /* rs */
.settings = {
[GPIOMUX_SUSPENDED] = &qpic_lcdc_rs,
},
},
};
static void msm9625_disp_init_gpiomux(void)
{
msm_gpiomux_install(msm9625_qpic_lcdc_configs,
ARRAY_SIZE(msm9625_qpic_lcdc_configs));
}
#else
static void msm9625_disp_init_gpiomux(void)
{
}
#endif /* CONFIG_FB_MSM_QPIC */
#ifdef CONFIG_MP2617_CHARGER
static struct gpiomux_setting mp2617_gpio_input_active_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
.dir = GPIOMUX_IN,
};
static struct gpiomux_setting mp2617_gpio_input_suspend_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
.dir = GPIOMUX_IN,
};
static struct gpiomux_setting mp2617_gpio_output_active_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct gpiomux_setting mp2617_gpio_output_suspend_cfg = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
};
/* refer to msm9625-mtp.dtsi */
static struct msm_gpiomux_config msm9625_mp2617_configs[] __initdata = {
{
.gpio = 13, /* Charge Enable, 1: Enable, 0: Disable */
.settings = {
[GPIOMUX_ACTIVE] = &mp2617_gpio_output_active_cfg,
[GPIOMUX_SUSPENDED] = &mp2617_gpio_output_suspend_cfg,
},
},
{
.gpio = 16, /* M0 */
.settings = {
[GPIOMUX_ACTIVE] = &mp2617_gpio_output_active_cfg,
[GPIOMUX_SUSPENDED] = &mp2617_gpio_output_suspend_cfg,
},
},
{
.gpio = 17, /* M1 */
.settings = {
[GPIOMUX_ACTIVE] = &mp2617_gpio_output_active_cfg,
[GPIOMUX_SUSPENDED] = &mp2617_gpio_output_suspend_cfg,
},
},
{
.gpio = 70, /* CHGOK, 0: Charging, 1: Complete */
.settings = {
[GPIOMUX_ACTIVE] = &mp2617_gpio_input_active_cfg,
[GPIOMUX_SUSPENDED] = &mp2617_gpio_input_suspend_cfg,
},
},
#ifdef CONFIG_POWER_BANK_DETECT_SUPPORT
{
.gpio = 14, /* Boost_EN, 0: Disbale, 1: Enable */
.settings = {
[GPIOMUX_ACTIVE] = &mp2617_gpio_output_active_cfg,
[GPIOMUX_SUSPENDED] = &mp2617_gpio_output_suspend_cfg,
},
},
#endif
};
#endif
#ifdef CONFIG_OLED_SSD1306_PT
static struct gpiomux_setting oled_ssd1306_gpio_active_config = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_UP,
.dir = GPIOMUX_OUT_HIGH,
};
static struct gpiomux_setting oled_ssd1306_gpio_suspend_config = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct gpiomux_setting oled_ssd1306_gpio_cs_config = {
.func = GPIOMUX_FUNC_1,
.drv = GPIOMUX_DRV_2MA,
.pull = GPIOMUX_PULL_NONE,
};
static struct msm_gpiomux_config msm9625_oled_ssd1306_configs[] __initdata = {
{
.gpio = 4, /* oled ssd1306 chip select */
.settings = {
[GPIOMUX_SUSPENDED] = &oled_ssd1306_gpio_suspend_config,
[GPIOMUX_ACTIVE] = &oled_ssd1306_gpio_active_config,
},
},
{
.gpio = 5, /* oled ssd1306 a0 */
.settings = {
[GPIOMUX_SUSPENDED] = &oled_ssd1306_gpio_suspend_config,
[GPIOMUX_ACTIVE] = &oled_ssd1306_gpio_active_config,
},
},
{
.gpio = 6, /* oled ssd1306 reset */
.settings = {
[GPIOMUX_SUSPENDED] = &oled_ssd1306_gpio_cs_config,
[GPIOMUX_ACTIVE] = &oled_ssd1306_gpio_active_config,
},
},
{
.gpio = 7, /* oled ssd1306 boost enable */
.settings = {
[GPIOMUX_SUSPENDED] = &oled_ssd1306_gpio_suspend_config,
[GPIOMUX_ACTIVE] = &oled_ssd1306_gpio_active_config,
},
},
{
.gpio = 10, /* oled ssd1306 I2C_DAT */
.settings = {
[GPIOMUX_SUSPENDED] = &gpio_i2c_config,
},
},
{
.gpio = 11, /* oled ssd1306 I2C_CLK */
.settings = {
[GPIOMUX_SUSPENDED] = &gpio_i2c_config,
},
},
};
#endif
void __init msm9625_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));
msm_gpiomux_install(wlan_ath6kl_configs,
ARRAY_SIZE(wlan_ath6kl_configs));
/* [houjihai start] */
msm_gpiomux_install(mdm9625_key_configs,
ARRAY_SIZE(mdm9625_key_configs));
/* [houjihai end] */
msm_gpiomux_install(sdc2_card_det_config,
ARRAY_SIZE(sdc2_card_det_config));
msm9625_disp_init_gpiomux();
#ifdef CONFIG_MP2617_CHARGER
msm_gpiomux_install(msm9625_mp2617_configs,
ARRAY_SIZE(msm9625_mp2617_configs));
#endif
#ifdef CONFIG_OLED_SSD1306_PT
msm_gpiomux_install(msm9625_oled_ssd1306_configs,
ARRAY_SIZE(msm9625_oled_ssd1306_configs));
#endif
}

2
kernel/arch/arm/mach-msm/clock-9625.c Executable file → Normal file
View File

@ -440,7 +440,7 @@ static struct rcg_clk ipa_clk_src = {
.cmd_rcgr_reg = IPA_CMD_RCGR,
.set_rate = set_rate_mnd,
.freq_tbl = ftbl_gcc_ipa_clk,
.current_freq = &ftbl_gcc_ipa_clk[2],
.current_freq = &rcg_dummy_freq,
.base = &virt_bases[GCC_BASE],
.c = {
.dbg_name = "ipa_clk_src",

View File

@ -67,16 +67,6 @@ int msm_gpiomux_write(unsigned gpio, enum msm_gpiomux_setting which,
unsigned long irq_flags;
struct gpiomux_setting *new_set;
struct msm_gpiomux_rec *rec = msm_gpiomux_recs + gpio;
/* [zhangtao start] */
#ifdef CONFIG_OLED_SSD1306_PT
enum OLED_SSD1306_GPIO_NUM {
GPIO_OLED_CS = 4,
GPIO_OLED_A0 = 5,
GPIO_OLED_RES = 6,
GPIO_OLED_BOOST_EN = 7,
};
#endif
/* [zhangtao end] */
ret = msm_gpiomux_store(gpio, which, setting, old_setting);
if (ret < 0)
@ -84,32 +74,8 @@ int msm_gpiomux_write(unsigned gpio, enum msm_gpiomux_setting which,
spin_lock_irqsave(&gpiomux_lock, irq_flags);
/* [zhangtao start] */
#ifdef CONFIG_OLED_SSD1306_PT
switch (gpio)
{
case GPIO_OLED_CS:
case GPIO_OLED_A0:
case GPIO_OLED_RES:
case GPIO_OLED_BOOST_EN:
if (old_setting == NULL) { // initialise oled gpio with active config
new_set = rec->sets[GPIOMUX_ACTIVE];
} else {
new_set = rec->ref ? rec->sets[GPIOMUX_ACTIVE] :
rec->sets[GPIOMUX_SUSPENDED];
}
break;
default:
new_set = rec->ref ? rec->sets[GPIOMUX_ACTIVE] :
rec->sets[GPIOMUX_SUSPENDED];
break;
}
#else
new_set = rec->ref ? rec->sets[GPIOMUX_ACTIVE] :
rec->sets[GPIOMUX_SUSPENDED];
#endif
/* [zhangtao end] */
if (new_set)
__msm_gpiomux_write(gpio, *new_set);

View File

@ -1,205 +0,0 @@
/*****************************************************************************
* Copyright (C), 2002-2014, TP-LINK TECHNOLOGIES CO., LTD.
*
* File Name: pm8019_ext.c
* Version: 1.0
* Description: Export some PM8019 software interfaces to sysfs.
*
* Author: LuoWei
* Create Date: 2014-04-10
*
* History:
* 01 10Apr14 LuoWei Create file
*****************************************************************************/
#include <linux/kobject.h>
#include <include/mach/msm_smem.h>
#include <linux/gpio.h>
#include <linux/stat.h>
#include "pm8019_ext.h"
typedef unsigned char uint8;
typedef unsigned short uint16;
typedef unsigned long long uint64;
/* [ouyangyi] add power on info */
char int_to_hex_char(int v)
{
if (v >= 0 && v < 10)
{
return ('0' + v);
}
else if (v >= 10 && v < 16)
{
return ('A' + v - 10);
}
else
{
return 0;
}
}
#define PMIC_PON_INFO_HEX_BITS 16
static ssize_t pmic_pon_info_show(struct kobject *kobj,
struct kobj_attribute *attr, char *buf)
{
uint64 pon_info = 0;
unsigned int size = 0;
int i = 0;
pon_info = *(uint64 *)smem_get_entry(SMEM_POWER_ON_STATUS_INFO, &size);
if (!size || !pon_info) {
pr_err("%s: Cannot get the pon_info\n", __func__);
return sprintf(buf, "0000000000000000\n");
}
for (i = 0; i < PMIC_PON_INFO_HEX_BITS; i++) {
buf[PMIC_PON_INFO_HEX_BITS - i - 1] =
int_to_hex_char((int)(pon_info & 0xF));
pon_info = pon_info >> 4;
}
buf[PMIC_PON_INFO_HEX_BITS] = '\n';
return (PMIC_PON_INFO_HEX_BITS + 1);
}
static struct kobj_attribute pmic_pon_info_attr = {
.attr = {
.name = "pon_info",
.mode = S_IRUGO,
},
.show = &pmic_pon_info_show,
};
static struct attribute *pmic_pon_info_attrs[] = {
&pmic_pon_info_attr.attr,
NULL
};
static struct attribute_group pmic_pon_info_attr_group = {
.attrs = pmic_pon_info_attrs,
};
/* [ouyangyi] add end */
#define PM_TRIGGER_BIT_START 1
#define PM_TRIGGER_BIT_END 9
/*
The function shows one byte of power on reason for User Level.
The power on reason struct is :
typedef struct
{
unsigned hard_reset : 1; //Hard reset event trigger
unsigned smpl : 1; //SMPL trigger
unsigned rtc : 1; //RTC trigger
unsigned dc_chg : 1; //DC Charger trigger
unsigned usb_chg : 1; //USB Charger trigger
unsigned pon1 : 1; //PON1 trigger
unsigned cblpwr : 1; //CBL_PWR1_N trigger
unsigned kpdpwr : 1; //KPDPWR_N trigger
}pm_pon_pon_reason_type;
buf[0] buf[1] buf[2] ... buf[8]
is reset hard_reset smpl ... kpdpwr
*/
static ssize_t pmic_pon_trigger_show(struct kobject *kobj,
struct kobj_attribute *attr, char *buf)
{
static int first_time = 1;
static uint64 reason = 0;
static unsigned int size = 0;
uint8 pon_reason = 0;
uint16 warm_reset_reason = 0;
uint16 soft_reset_reason = 0;
int i = 0;
if (first_time) {
first_time = 0;
/*
* There are 8 bytes in field SMEM_POWER_ON_STATUS_INFO, which contains
* reasons for Power On(1 byte), Warm Reset(2 bytes), Power Off(2 bytes)
* , Soft Reset(2 bytes) and reserved byte(1 byte).
* The system is Litter-Endian, the last byte is power on reason.
*/
reason = *(uint64 *)smem_get_entry(SMEM_POWER_ON_STATUS_INFO,
&size);
}
if (!size || !reason) {
pr_err("%s: Cannot get the reasons\n", __func__);
return sprintf(buf, "000000000\n");
}
pon_reason = (reason & 0xFF);
warm_reset_reason = (reason >> (1 * 8)) & 0xFFFF;
soft_reset_reason = (reason >> ((1 + 2 + 2) * 8)) & 0xFFFF;
if (warm_reset_reason || soft_reset_reason) {
buf[0] = '1';
} else {
buf[0] = '0';
}
for (i = PM_TRIGGER_BIT_START; i < PM_TRIGGER_BIT_END; i++) {
if (pon_reason & (1 << (i - PM_TRIGGER_BIT_START))) {
buf[i] = '1';
} else {
buf[i] = '0';
}
}
buf[PM_TRIGGER_BIT_END] = '\n';
return PM_TRIGGER_BIT_END + 1;
}
/*
* Export sysfs interface.
* "cat /sys/pmic/pon_trigger" shows the power-on reason
*/
static struct kobj_attribute pmic_trigger_attr = {
.attr = {
.name = "pon_trigger",
.mode = S_IRUGO,
},
.show = &pmic_pon_trigger_show,
};
static struct attribute *pmic_trigger_attrs[] = {
&pmic_trigger_attr.attr,
NULL
};
static struct attribute_group pmic_trigger_attr_group = {
.attrs = pmic_trigger_attrs,
};
void export_pmic_interface(void)
{
struct kobject* kobj;
int ret;
kobj = kobject_create_and_add("pmic", NULL);
if (!kobj) {
pr_err("%s: failed to export PMIC interface\n", __func__);
return;
}
ret = sysfs_create_group(kobj, &pmic_trigger_attr_group);
if (!kobj || ret) {
pr_err("%s: failed to export PMIC trigger interface\n", __func__);
}
ret = sysfs_create_group(kobj, &pmic_pon_info_attr_group);
if (!kobj || ret) {
pr_err("%s: failed to export PMIC pon_info interface\n", __func__);
}
}

View File

@ -1,25 +0,0 @@
/*****************************************************************************
* Copyright (C), 2002-2014, TP-LINK TECHNOLOGIES CO., LTD.
*
* File Name: pm8019_ext.h
* Version: 1.0
* Description: Export some PM8019 software interfaces to sysfs.
*
* Author: LuoWei
* Create Date: 2014-04-10
*
* History:
* 01 10Apr14 LuoWei Create file
*****************************************************************************/
#ifndef __PM8019_EXT_H__
#define __PM8019_EXT_H__
#ifdef CONFIG_TPLINK_PMIC_EXT
void export_pmic_interface(void);
#else
void export_pmic_interface(void){}
#endif
#endif /* __PM8019_EXT_H__ */

View File

@ -68,7 +68,7 @@ static void *dload_mode_addr;
/* Download mode master kill-switch */
static int dload_set(const char *val, struct kernel_param *kp);
static int download_mode = 0;
static int download_mode = 1;
module_param_call(download_mode, dload_set, param_get_int,
&download_mode, 0644);