示例#1
0
void __init lge_add_input_devices(void)
{
    int rc = 0;

    gpio_tlmm_config(GPIO_CFG(TS_GPIO_IRQ, 0, GPIO_CFG_INPUT, GPIO_CFG_NO_PULL, GPIO_CFG_2MA), GPIO_CFG_ENABLE);
    gpio_tlmm_config(GPIO_CFG(TS_GPIO_I2C_SDA, 1, GPIO_CFG_INPUT, GPIO_CFG_NO_PULL, GPIO_CFG_2MA), GPIO_CFG_ENABLE);
    gpio_tlmm_config(GPIO_CFG(TS_GPIO_I2C_SCL, 1, GPIO_CFG_INPUT, GPIO_CFG_NO_PULL, GPIO_CFG_2MA), GPIO_CFG_ENABLE);

    gpio_tlmm_config(GPIO_CFG(TS_GPIO_RESET, 0, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_2MA), GPIO_CFG_ENABLE);
    rc = gpio_request(MSM_8930_TS_MAKER_ID, "TOUCH_PANEL_MAKERID");

    if (unlikely(rc < 0))
        pr_err("%s not able to get gpio\n", __func__);

    /*	maker_id set 0 - normal , maker_id set 1 - dummy pattern */
    gpio_direction_input(MSM_8930_TS_MAKER_ID);

    ts_set_vreg(1, false);

    i2c_register_board_info(MSM_8930_GSBI3_QUP_I2C_BUS_ID,
                            (&msm_i2c_synaptics_ts_info[0]), 1);

//
#if defined(CONFIG_MACH_LGE_FX3_SPCS)
    if(system_rev < HW_REV_B) {
        keys_8930[1].gpio = PM8038_GPIO_PM_TO_SYS(8);
        printk("%s : VOL_DOWN pin is changed to PM_GPIO(8) for SPCS Rev.A\n", __func__);
    }
#endif
    platform_device_register(&gpio_keys_8930);
//

}
示例#2
0
/* ---- MMC ---- */
int __init k2_ul_init_mmc()
{
    uint32_t id;
    struct pm_gpio pm_config;
    wifi_status_cb = NULL;

    printk(KERN_INFO "k2_ul: %s\n", __func__);

    /* SDC4: WiFi */

#if 1 /* Temp solution to turn on sleep clock, remove this after GPIO conflict is resolved */

    pm_config.direction = PM_GPIO_DIR_OUT;
    pm_config.output_buffer = PM_GPIO_OUT_BUF_CMOS;
    pm_config.output_value = 0;
    pm_config.pull = PM_GPIO_PULL_NO;
    pm_config.vin_sel = PM8038_GPIO_VIN_L11;
    pm_config.out_strength = PM_GPIO_STRENGTH_HIGH;
    pm_config.function = PM_GPIO_FUNC_1;
    pm_config.inv_int_pol = 0;
    pm_config.disable_pin = 0;
    pm8xxx_gpio_config(PM8038_GPIO_PM_TO_SYS(8), &pm_config);
    mdelay(5);
#endif

    /* initial WIFI IO 1V8 */
    /*
    	id = GPIO_CFG(MSM_V_WL_IO_1V8_EN, 0, GPIO_CFG_OUTPUT,
    		GPIO_CFG_NO_PULL, GPIO_CFG_2MA);
    	gpio_tlmm_config(id, 0);
    	gpio_set_value(MSM_V_WL_IO_1V8_EN, 1);
    */
    /* initial WL_DEV_WAKE (CPU wakeup wifi) */
    id = GPIO_CFG(MSM_WL_DEV_WAKE, 0, GPIO_CFG_OUTPUT,
                  GPIO_CFG_NO_PULL, GPIO_CFG_2MA);
    gpio_tlmm_config(id, 0);
    gpio_set_value(MSM_WL_DEV_WAKE, 1);

    /* initial WL_REG_ON (wifi wakeup CPU) */
    id = GPIO_CFG(MSM_WL_REG_ON, 0, GPIO_CFG_OUTPUT,
                  GPIO_CFG_NO_PULL, GPIO_CFG_2MA);
    gpio_tlmm_config(id, 0);
    gpio_set_value(MSM_WL_REG_ON, 0);

    /* PM QoS for wifi*/
    k2_ul_wifi_data.cpu_dma_latency = msm_rpmrs_levels[0].latency_us;

    msm_add_sdcc(4, &k2_ul_wifi_data);

    return 0;
}
示例#3
0
int __init k2_plc_cl_init_mmc()
{
	uint32_t id;
	struct pm_gpio pm_config;
	wifi_status_cb = NULL;

	printk(KERN_INFO "k2_plc_cl: %s\n", __func__);

	

#if 1 

	pm_config.direction = PM_GPIO_DIR_OUT;
	pm_config.output_buffer = PM_GPIO_OUT_BUF_CMOS;
	pm_config.output_value = 0;
	pm_config.pull = PM_GPIO_PULL_NO;
	pm_config.vin_sel = PM8038_GPIO_VIN_L11;
	pm_config.out_strength = PM_GPIO_STRENGTH_HIGH;
	pm_config.function = PM_GPIO_FUNC_1;
	pm_config.inv_int_pol = 0;
	pm_config.disable_pin = 0;
	pm8xxx_gpio_config(PM8038_GPIO_PM_TO_SYS(8), &pm_config);
	mdelay(5);
#endif

	
	id = GPIO_CFG(MSM_V_WL_IO_1V8_EN, 0, GPIO_CFG_OUTPUT,
		GPIO_CFG_NO_PULL, GPIO_CFG_2MA);
	gpio_tlmm_config(id, 0);
	gpio_set_value(MSM_V_WL_IO_1V8_EN, 1);

	
	id = GPIO_CFG(MSM_WL_DEV_WAKE, 0, GPIO_CFG_OUTPUT,
		GPIO_CFG_NO_PULL, GPIO_CFG_2MA);
	gpio_tlmm_config(id, 0);
	gpio_set_value(MSM_WL_DEV_WAKE, 1);

	
	id = GPIO_CFG(MSM_WL_REG_ON, 0, GPIO_CFG_OUTPUT,
		GPIO_CFG_NO_PULL, GPIO_CFG_2MA);
	gpio_tlmm_config(id, 0);
	gpio_set_value(MSM_WL_REG_ON, 0);

	
	k2_plc_cl_wifi_data.cpu_dma_latency = msm_rpmrs_levels[0].latency_us;

	msm_add_sdcc(4, &k2_plc_cl_wifi_data);

	return 0;
}
			[GPIOMUX_SUSPENDED] = &fsa9485_suspend_cfg,
		},
	},
};
#endif

#ifdef CONFIG_2MIC_ES305
static struct msm_gpiomux_config audience_suspend_configs[] __initdata = {
	{
		.gpio    = GPIO_2MIC_PW_DN,
		.settings = {
			[GPIOMUX_SUSPENDED] = &audience_suspend_gpio_config,
		},
	},
	{
		.gpio    = PM8038_GPIO_PM_TO_SYS(PMIC_GPIO_2MIC_RST),
		.settings = {
			[GPIOMUX_SUSPENDED] = &audience_suspend_gpio_config,
		},
	},
};
#endif

int __init msm8930_init_gpiomux(void)
{
	int rc = msm_gpiomux_init(NR_GPIO_IRQS);
	if (rc) {
		pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc);
		return rc;
	}
示例#5
0
static struct clk *codec_clk;
static int clk_users;

static int msm8930_useuro_gpio_requested;
static struct mutex cdc_mclk_mutex;

static struct snd_soc_jack hs_jack;
static struct snd_soc_jack button_jack;
static atomic_t auxpcm_rsc_ref;

static int msm8930_enable_codec_ext_clk(
		struct snd_soc_codec *codec, int enable,
		bool dapm);
static bool msm8930_swap_gnd_mic(struct snd_soc_codec *codec);

static u32 spkr_boost_enable_gpio = PM8038_GPIO_PM_TO_SYS(0x1);

struct pm_gpio SPKR_ON = {
	.direction      = PM_GPIO_DIR_OUT,
	.output_buffer  = PM_GPIO_OUT_BUF_CMOS,
	.output_value   = 1,
	.pull      = PM_GPIO_PULL_NO,
	.vin_sel   = PM_GPIO_VIN_S4,
	.out_strength   = PM_GPIO_STRENGTH_MED,
	.function       = PM_GPIO_FUNC_NORMAL,
};
struct pm_gpio SPKR_OFF = {
	.direction      = PM_GPIO_DIR_OUT,
	.output_buffer  = PM_GPIO_OUT_BUF_CMOS,
	.output_value   = 0,
	.pull      = PM_GPIO_PULL_NO,
static int msm8930_btsco_ch = 1;
static int hdmi_rate_variable;
static int msm_hdmi_rx_ch = 2;
static struct clk *codec_clk;
static int clk_users;

static int msm8930_useuro_gpio_requested;
static struct mutex cdc_mclk_mutex;

static struct snd_soc_jack hs_jack;
static struct snd_soc_jack button_jack;
static atomic_t auxpcm_rsc_ref;

/* ZTE_Audio_LCX_130325, lichaoxia, 2013-03-25, start */
#if defined(CONFIG_US_EURO_SWITCH)
static u32 us_euro_sel_gpio = PM8038_GPIO_PM_TO_SYS(JACK_US_EURO_SEL_GPIO);
#endif
/* ZTE_Audio_LCX_130325, lichaoxia, 2013-03-25, end */
static int msm8930_enable_codec_ext_clk(
		struct snd_soc_codec *codec, int enable,
		bool dapm);
static bool msm8930_swap_gnd_mic(struct snd_soc_codec *codec);

//static u32 spkr_boost_enable_gpio = PM8038_GPIO_PM_TO_SYS(0x1);

struct pm_gpio SPKR_ON = {
	.direction      = PM_GPIO_DIR_OUT,
	.output_buffer  = PM_GPIO_OUT_BUF_CMOS,
	.output_value   = 1,
	.pull      = PM_GPIO_PULL_NO,
	.vin_sel   = PM_GPIO_VIN_S4,
	.wpswitch_gpio	= PM8921_GPIO_PM_TO_SYS(16),
#else
	.wpswitch_gpio	= 66,
	.is_wpswitch_active_low = true,
#endif
#endif
	.vreg_data	= &mmc_slot_vreg_data[SDCC3],
	.pin_data	= &mmc_slot_pin_data[SDCC3],
#ifndef CONFIG_MACH_SERRANO
/*TODO: Insert right replacement for PM8038 */
#ifndef MSM8930_PHASE_2
	.status_gpio	= PM8921_GPIO_PM_TO_SYS(26),
	.status_irq	= PM8921_GPIO_IRQ(PM8921_IRQ_BASE, 26),
#else
#ifdef PMIC_GPIO_SD_CARD_DET_N
        .status_gpio = PM8038_GPIO_PM_TO_SYS(PMIC_GPIO_SD_CARD_DET_N),
        .status_irq = PM8038_GPIO_IRQ(PM8038_IRQ_BASE, PMIC_GPIO_SD_CARD_DET_N),
#else
        .status_gpio    = GPIO_SD_CARD_DET_N,
        .status_irq     = MSM_GPIO_TO_INT(GPIO_SD_CARD_DET_N),
#endif
#endif
#endif
	.irq_flags	= IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
	.is_status_gpio_active_low = true,
	.xpc_cap	= 1,
/* Disable UHS feature
	.uhs_caps	= (MMC_CAP_UHS_SDR12 | MMC_CAP_UHS_SDR25 |
			MMC_CAP_UHS_SDR50 | MMC_CAP_UHS_DDR50 |
			MMC_CAP_UHS_SDR104 | MMC_CAP_MAX_CURRENT_800),
*/