Пример #1
0
	gpio_direction_output(MAHIMAHI_GPIO_DS2482_SLP_N, n);
}

static struct tpa2018d1_platform_data tpa2018_data = {
	.gpio_tpa2018_spk_en = MAHIMAHI_CDMA_GPIO_AUD_SPK_AMP_EN,
};

static struct i2c_board_info base_i2c_devices[] = {
	{
		I2C_BOARD_INFO("ds2482", 0x30 >> 1),
		.platform_data = ds2482_set_slp_n,
	},
	{
		I2C_BOARD_INFO("cy8c-tmg-ts", 0x34),
		.platform_data = &mahimahi_cy8c_ts_data,
		.irq = MSM_GPIO_TO_INT(MAHIMAHI_GPIO_TP_INT_N),
	},
	{
		I2C_BOARD_INFO(SYNAPTICS_I2C_RMI_NAME, 0x40),
		.platform_data = mahimahi_synaptics_ts_data,
		.irq = MSM_GPIO_TO_INT(MAHIMAHI_GPIO_TP_INT_N)
	},
	{
		I2C_BOARD_INFO("mahimahi-microp", 0x66),
		.irq = MSM_GPIO_TO_INT(MAHIMAHI_GPIO_UP_INT_N)
	},
	{
		I2C_BOARD_INFO("s5k3e2fx", 0x20 >> 1),
	},
	{
		I2C_BOARD_INFO("tps65023", 0x48),
static struct touch_platform_data j1_ts_data = {
	.int_pin	= SYNAPTICS_TS_I2C_INT_GPIO,
	.reset_pin	= TOUCH_RESET,
	.maker		= "Synaptics",
	.fw_version	= "E129",
	.caps		= &touch_caps,
	.role		= &touch_role,
	.pwr		= &touch_pwr,
};

static struct i2c_board_info synaptics_ts_info[] = {
	[0] = {
		I2C_BOARD_INFO(LGE_TOUCH_NAME, 0x20),
		.platform_data = &j1_ts_data,
		.irq = MSM_GPIO_TO_INT(SYNAPTICS_TS_I2C_INT_GPIO),
	},
};
#endif





#if defined(CONFIG_RMI4_I2C)
struct syna_gpio_data {
	u16 gpio_number;
	char *gpio_name;
};

static int synaptics_touchpad_gpio_setup(void *gpio_data, bool configure)
    SEC_BATTERY_FULL_CONDITION_VCELL,
    .full_condition_soc = 97,
    .full_condition_vcell = 4300,

    .recharge_check_count = 2,
    .recharge_condition_type =
    SEC_BATTERY_RECHARGE_CONDITION_VCELL,
    .recharge_condition_soc = 98,
    .recharge_condition_vcell = 4300,

    .charging_total_time = 6 * 60 * 60,
    .recharging_total_time = 90 * 60,
    .charging_reset_time = 0,

    /* Fuel Gauge */
    .fg_irq = MSM_GPIO_TO_INT(GPIO_FUEL_INT),
    .fg_irq_attr =
    IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING,
    .fuel_alert_soc = 4,
    .repeated_fuelalert = false,
    .capacity_calculation_type =
    SEC_FUELGAUGE_CAPACITY_TYPE_RAW |
    SEC_FUELGAUGE_CAPACITY_TYPE_SCALE |
    SEC_FUELGAUGE_CAPACITY_TYPE_DYNAMIC_SCALE,
    /* SEC_FUELGAUGE_CAPACITY_TYPE_ATOMIC, */
#if defined(CONFIG_MACH_MELIUS_SKT) || defined(CONFIG_MACH_MELIUS_KTT) || \
	defined(CONFIG_MACH_MELIUS_LGT)
    .capacity_max = 970,
#else
    .capacity_max = 1000,
#endif
Пример #4
0
#include <linux/slab.h>
#include <linux/jiffies.h>
#include <linux/sysdev.h>
#include <linux/types.h>
#include <linux/time.h>
#include <linux/version.h>
#include <mach/gpio.h>
#include <linux/input/lge_f200_hall_ic.h>


static struct f200_hall_ic_pdata_type f200_hall_ic_pdata = {
	.s_gpio = GPIO_CRADLE_DETECT_S,
	.n_gpio = GPIO_CRADLE_DETECT_N,
	.s_state = 0,
	.n_state = 0,
	.hall_ic_s_irq = MSM_GPIO_TO_INT(GPIO_CRADLE_DETECT_S),
	.hall_ic_n_irq = MSM_GPIO_TO_INT(GPIO_CRADLE_DETECT_N),
	.irqf_trigger_mode = IRQF_TRIGGER_RISING|IRQF_TRIGGER_FALLING,
};



static void hall_ic_report_event(struct f200_hall_ic_pdata_type *pdata)
{
	printk("%s\n", __FUNCTION__);

	input_report_switch(pdata->input_dev_hall_ic, SW_FRONT_COVER, pdata->n_state);
	input_sync(pdata->input_dev_hall_ic);

	return;
#endif

#ifdef CONFIG_MMC_MSM_SDC4_SUPPORT
static unsigned int sdc4_sup_clk_rates[] = {
	400000, 24000000, 48000000
};

static struct mmc_platform_data msm8960_sdc4_data = {
	.ocr_mask       = MMC_VDD_165_195,
	.mmc_bus_width  = MMC_CAP_4_BIT_DATA,
	.sup_clk_table  = sdc4_sup_clk_rates,
	.sup_clk_cnt    = ARRAY_SIZE(sdc4_sup_clk_rates),
	.pclk_src_dfab  = 1,
	.vreg_data      = &mmc_slot_vreg_data[SDCC4],
	.pin_data       = &mmc_slot_pin_data[SDCC4],
	.sdiowakeup_irq = MSM_GPIO_TO_INT(85),
	.msm_bus_voting_data = &sps_to_ddr_bus_voting_data,
};
#endif

void __init fighter_init_mmc(void)
{
#ifdef CONFIG_MMC_MSM_SDC1_SUPPORT
	
	msm_add_sdcc(1, &msm8960_sdc1_data);
#endif
#ifdef CONFIG_MMC_MSM_SDC2_SUPPORT
	
	msm_add_sdcc(2, &msm8960_sdc2_data);
#endif
#ifdef CONFIG_MMC_MSM_SDC3_SUPPORT
Пример #6
0
static void __init htcleo_init(void)
{
#ifdef CONFIG_HTCLEO_BLINK_AT_BOOT
	volatile unsigned *bank6_in, *bank6_out;
#endif
	printk("htcleo_init()\n");

	msm_hw_reset_hook = htcleo_reset;

#ifdef CONFIG_PERFLOCK
	perflock_init(&htcleo_perflock_data);
#endif

	msm_serial_debug_init(MSM_UART1_PHYS, INT_UART1,
			      &msm_device_uart1.dev, 1, MSM_GPIO_TO_INT(139));

//	config_gpio_table(misc_gpio_table, ARRAY_SIZE(misc_gpio_table));

	config_gpio_table(bt_gpio_table, ARRAY_SIZE(bt_gpio_table));

		gpio_request(HTCLEO_GPIO_TP_LS_EN, "tp_ls_en");
	gpio_direction_output(HTCLEO_GPIO_TP_LS_EN, 0);
	gpio_request(HTCLEO_GPIO_TP_EN, "tp_en");
	gpio_direction_output(HTCLEO_GPIO_TP_EN, 0);
//	gpio_request(HTCLEO_GPIO_PROXIMITY_EN, "proximity_en");
//	gpio_direction_output(HTCLEO_GPIO_PROXIMITY_EN, 1);
	gpio_request(HTCLEO_GPIO_LS_EN_N, "ls_en");
	gpio_request(HTCLEO_GPIO_COMPASS_RST_N, "compass_rst");
	gpio_direction_output(HTCLEO_GPIO_COMPASS_RST_N, 1);
	gpio_request(HTCLEO_GPIO_COMPASS_INT_N, "compass_int");
	gpio_direction_input(HTCLEO_GPIO_COMPASS_INT_N);

	gpio_request(HTCLEO_GPIO_DS2482_SLP_N, "ds2482_slp_n");

	/* set the gpu power rail to manual mode so clk en/dis will not
	 * turn off gpu power, and hang it on resume */
	htcleo_kgsl_power_rail_mode(0);
	htcleo_kgsl_power(true);

	msm_device_hsusb.dev.platform_data = &msm_hsusb_pdata;
	msm_device_uart_dm1.dev.platform_data = &msm_uart_dm1_pdata;

	platform_add_devices(devices, ARRAY_SIZE(devices));

	i2c_register_board_info(0, base_i2c_devices,
		ARRAY_SIZE(base_i2c_devices));

	if (htcleo_init_mmc(system_rev, debug_uart) != 0)
		pr_crit("%s: Unable to initialize MMC\n", __func__);

	htcleo_audio_init();
	htcleo_headset_init();

	platform_device_register(&htcleo_timed_gpios);

	ds2784_battery_init();

	msm_acpu_clock_init(&htcleo_clock_data);



//}   what's this??


#ifdef CONFIG_SERIAL_MSM_HS
	msm_device_uart_dm1.dev.platform_data = &msm_uart_dm1_pdata;
	msm_device_uart_dm1.name = "msm_serial_hs"; /* for bcm */
	msm_device_uart_dm1.resource[3].end = 6;
#endif

	config_gpio_table(bt_gpio_table, ARRAY_SIZE(bt_gpio_table));

//	bt_export_bd_address();

	htcleo_audio_init();

//	msm_device_i2c_init();

	/* set the gpu power rail to manual mode so clk en/dis will not
	* turn off gpu power, and hang it on resume */

	htcleo_kgsl_power_rail_mode(0);
	htcleo_kgsl_power(false);
	mdelay(100);
	htcleo_kgsl_power(true);

	platform_add_devices(devices, ARRAY_SIZE(devices));

	htcleo_init_panel();


	i2c_register_board_info(0, base_i2c_devices, ARRAY_SIZE(base_i2c_devices));

#ifdef CONFIG_USB_ANDROID
//	htcleo_add_usb_devices();
#endif

//	htcleo_init_mmc(0);
	platform_device_register(&htcleo_timed_gpios);


	/* Blink the camera LED shortly to show that we're alive! */
#ifdef CONFIG_HTCLEO_BLINK_AT_BOOT
	bank6_in = (unsigned int*)(MSM_GPIO1_BASE + 0x0864);
	bank6_out = (unsigned int*)(MSM_GPIO1_BASE + 0x0814);
	*bank6_out = *bank6_in ^ 0x200000;
	mdelay(50);
	*bank6_out = *bank6_in | 0x200000;
	mdelay(200);
#endif

}
Пример #7
0
		else
			wlan_static_skb[i] = dev_alloc_skb(8192);
	}
	for (i = 0; (i < PREALLOC_WLAN_NUMBER_OF_SECTIONS); i++) {
		wifi_mem_array[i].mem_ptr = kmalloc(wifi_mem_array[i].size,
							GFP_KERNEL);
		if (wifi_mem_array[i].mem_ptr == NULL)
			return -ENOMEM;
	}
	return 0;
}

static struct resource pyramid_wifi_resources[] = {
	[0] = {
		.name		= "bcm4329_wlan_irq",
		.start		= MSM_GPIO_TO_INT(PYRAMID_GPIO_WIFI_IRQ),
		.end		= MSM_GPIO_TO_INT(PYRAMID_GPIO_WIFI_IRQ),
#ifdef HW_OOB
		.flags          = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL | IORESOURCE_IRQ_SHAREABLE,
#else
		.flags          = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
#endif
	},
};

static struct wifi_platform_data pyramid_wifi_control = {
	.set_power      = pyramid_wifi_power,
	.set_reset      = pyramid_wifi_reset,
	.set_carddetect = pyramid_wifi_set_carddetect,
	.mem_prealloc   = pyramid_wifi_mem_prealloc,
	.get_mac_addr	= pyramid_wifi_get_mac_addr,
Пример #8
0
		.settings = {
			[GPIOMUX_ACTIVE]    = &cam_settings[3],
			[GPIOMUX_SUSPENDED] = &cam_settings[0],
		},
	},
};

#define VFE_CAMIF_TIMER1_GPIO 2
#define VFE_CAMIF_TIMER2_GPIO 3
#define VFE_CAMIF_TIMER3_GPIO_INT 4
static struct msm_camera_sensor_strobe_flash_data strobe_flash_xenon = {
	.flash_trigger = VFE_CAMIF_TIMER2_GPIO,
	.flash_charge = VFE_CAMIF_TIMER1_GPIO,
	.flash_charge_done = VFE_CAMIF_TIMER3_GPIO_INT,
	.flash_recharge_duration = 50000,
	.irq = MSM_GPIO_TO_INT(VFE_CAMIF_TIMER3_GPIO_INT),
};

/*
 * QCT Original
 *
 * NOT USED!
 *
 */
#if !defined(CONFIG_MACH_LGE)
#ifdef CONFIG_MSM_CAMERA_FLASH
static struct msm_camera_sensor_flash_src msm_flash_src = {
	.flash_sr_type = MSM_CAMERA_FLASH_SRC_EXT,
	._fsrc.ext_driver_src.led_en = VFE_CAMIF_TIMER1_GPIO,
	._fsrc.ext_driver_src.led_flash_en = VFE_CAMIF_TIMER2_GPIO,
	._fsrc.ext_driver_src.flash_id = MAM_CAMERA_EXT_LED_FLASH_SC628A,
static unsigned int marvelc_sdslot_status(struct device *dev)
{
	unsigned int status;

	status = (unsigned int) gpio_get_value(MARVELC_GPIO_SDMC_CD_N);
	return (!status);
}

#define MARVELC_MMC_VDD		(MMC_VDD_28_29 | MMC_VDD_29_30)

static unsigned int marvelc_sdslot_type = MMC_TYPE_SD;

static struct mmc_platform_data marvelc_sdslot_data = {
	.ocr_mask	= MARVELC_MMC_VDD,
	.status_irq	= MSM_GPIO_TO_INT(MARVELC_GPIO_SDMC_CD_N),
	.status		= marvelc_sdslot_status,
	.translate_vdd	= marvelc_sdslot_switchvdd,
	.slot_type	= &marvelc_sdslot_type,
};

/* ---- WIFI ---- */

static uint32_t wifi_on_gpio_table[] = {
	PCOM_GPIO_CFG(51, 1, GPIO_OUTPUT, GPIO_PULL_UP, GPIO_8MA), /* DAT3 */
	PCOM_GPIO_CFG(52, 1, GPIO_OUTPUT, GPIO_PULL_UP, GPIO_8MA), /* DAT2 */
	PCOM_GPIO_CFG(53, 1, GPIO_OUTPUT, GPIO_PULL_UP, GPIO_8MA), /* DAT1 */
	PCOM_GPIO_CFG(54, 1, GPIO_OUTPUT, GPIO_PULL_UP, GPIO_8MA), /* DAT0 */
	PCOM_GPIO_CFG(55, 1, GPIO_OUTPUT, GPIO_PULL_UP, GPIO_8MA), /* CMD */
	PCOM_GPIO_CFG(56, 1, GPIO_OUTPUT, GPIO_NO_PULL, GPIO_16MA), /* CLK */
	PCOM_GPIO_CFG(29, 0, GPIO_INPUT, GPIO_NO_PULL, GPIO_4MA),  /* WLAN IRQ */
#ifndef MSM8930_PHASE_2
	.wpswitch_gpio	= PM8921_GPIO_PM_TO_SYS(16),
#else
	.wpswitch_gpio	= 66,
	.wpswitch_polarity = 1,
#endif
#endif
	.vreg_data	= &mmc_slot_vreg_data[SDCC3],
	.pin_data	= &mmc_slot_pin_data[SDCC3],
#ifdef CONFIG_MMC_MSM_CARD_HW_DETECTION
#ifndef MSM8930_PHASE_2
	.status_gpio	= PM8921_GPIO_PM_TO_SYS(SD_CDETz),
	.status_irq	= PM8921_GPIO_IRQ(PM8921_IRQ_BASE, SD_CDETz),
#else
	.status_gpio	= SD_CDETz,
	.status_irq	= MSM_GPIO_TO_INT(SD_CDETz),
#endif
	.irq_flags	= IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
	.is_status_gpio_active_low = true,
#endif
#if 0
	.xpc_cap	= 1,
	.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),
#endif
	.msm_bus_voting_data = &sps_to_ddr_bus_voting_data,
};
#endif

void __init msm8930_init_mmc(void)
Пример #11
0
int mmc_wimax_get_hostwakeup_IRQ_ID(void)
{
	return MSM_GPIO_TO_INT(mmc_wimax_get_hostwakeup_gpio());
}
		gpio_direction_output(132, 1);
}

static void charm_ap2mdm_kpdpwr_off(void)
{
	if (machine_is_msm8x60_charm_surf())
		gpio_direction_output(132, 1);
	else
		gpio_direction_output(132, 0);

}

static struct resource charm_resources[] = {
	/* MDM2AP_ERRFATAL */
	{
		.start	= MSM_GPIO_TO_INT(133),
		.end	= MSM_GPIO_TO_INT(133),
		.flags = IORESOURCE_IRQ,
	},
	/* MDM2AP_STATUS */
	{
		.start	= MSM_GPIO_TO_INT(134),
		.end	= MSM_GPIO_TO_INT(134),
		.flags = IORESOURCE_IRQ,
	}
};

static struct charm_platform_data mdm_platform_data = {
	.charm_modem_on		= charm_ap2mdm_kpdpwr_on,
	.charm_modem_off	= charm_ap2mdm_kpdpwr_off,
};
Пример #13
0
		.end   = DMOV_HSUART1_RX_CHAN,
		.name  = "uartdm_channels",
		.flags = IORESOURCE_DMA,
	},
	{
		.start = DMOV_HSUART1_TX_CRCI,
		.end   = DMOV_HSUART1_RX_CRCI,
		.name  = "uartdm_crci",
		.flags = IORESOURCE_DMA,
	},
};

static u64 msm_uart_dm1_dma_mask = DMA_BIT_MASK(32);

static struct msm_serial_hs_platform_data bt_uart_platform_data = {
	.wakeup_irq = MSM_GPIO_TO_INT(44),
	.wakeup_edge = IRQF_TRIGGER_RISING,
};

struct platform_device msm_device_uart_dm1 = {
	.name = "msm_serial_hs",
	.id = 0,
	.num_resources = ARRAY_SIZE(msm_uart1_dm_resources),
	.resource = msm_uart1_dm_resources,
	.dev		= {
		.dma_mask = &msm_uart_dm1_dma_mask,
		.coherent_dma_mask = DMA_BIT_MASK(32),
		.platform_data = &bt_uart_platform_data,
	},
};
Пример #14
0
static void __init mahimahi_init(void)
{
	int ret;
	struct kobject *properties_kobj;

	printk("mahimahi_init() revision=%d\n", system_rev);

	if (is_cdma_version(system_rev))
		smd_set_channel_list(smd_cdma_default_channels,
					ARRAY_SIZE(smd_cdma_default_channels));

	msm_hw_reset_hook = mahimahi_reset;

	if (is_cdma_version(system_rev))
		msm_acpu_clock_init(&mahimahi_cdma_clock_data);
	else
		msm_acpu_clock_init(&mahimahi_clock_data);

	msm_serial_debug_init(MSM_UART1_PHYS, INT_UART1,
			      &msm_device_uart1.dev, 1, MSM_GPIO_TO_INT(139));

	config_gpio_table(misc_gpio_table, ARRAY_SIZE(misc_gpio_table));

	if (is_cdma_version(system_rev)) {
		bcm_bt_lpm_pdata.gpio_wake = MAHIMAHI_CDMA_GPIO_BT_WAKE;
		mahimahi_flashlight_data.torch = MAHIMAHI_CDMA_GPIO_FLASHLIGHT_TORCH;
		config_gpio_table(bt_gpio_table_rev_CX, ARRAY_SIZE(bt_gpio_table_rev_CX));
	} else {
		config_gpio_table(bt_gpio_table, ARRAY_SIZE(bt_gpio_table));
	}

	gpio_request(MAHIMAHI_GPIO_TP_LS_EN, "tp_ls_en");
	gpio_direction_output(MAHIMAHI_GPIO_TP_LS_EN, 0);
	gpio_request(MAHIMAHI_GPIO_TP_EN, "tp_en");
	gpio_direction_output(MAHIMAHI_GPIO_TP_EN, 0);
	gpio_request(MAHIMAHI_GPIO_PROXIMITY_EN, "proximity_en");
	gpio_direction_output(MAHIMAHI_GPIO_PROXIMITY_EN, 1);
	gpio_request(MAHIMAHI_GPIO_COMPASS_RST_N, "compass_rst");
	gpio_direction_output(MAHIMAHI_GPIO_COMPASS_RST_N, 1);
	gpio_request(MAHIMAHI_GPIO_COMPASS_INT_N, "compass_int");
	gpio_direction_input(MAHIMAHI_GPIO_COMPASS_INT_N);

	gpio_request(MAHIMAHI_GPIO_DS2482_SLP_N, "ds2482_slp_n");

	/* set the gpu power rail to manual mode so clk en/dis will not
	 * turn off gpu power, and hang it on resume */
	mahimahi_kgsl_power_rail_mode(0);
	mahimahi_kgsl_power(true);

	msm_device_hsusb.dev.platform_data = &msm_hsusb_pdata;
	msm_device_uart_dm1.dev.platform_data = &msm_uart_dm1_pdata;

	platform_add_devices(devices, ARRAY_SIZE(devices));

	i2c_register_board_info(0, base_i2c_devices,
		ARRAY_SIZE(base_i2c_devices));

	if (system_rev == 0) {
		/* Only board after XB with Audience A1026 */
		i2c_register_board_info(0, rev0_i2c_devices,
			ARRAY_SIZE(rev0_i2c_devices));
	}

	if (system_rev > 0) {
		/* Only board after XB with Audience A1026 */
		i2c_register_board_info(0, rev1_i2c_devices,
			ARRAY_SIZE(rev1_i2c_devices));
	}

	if (is_cdma_version(system_rev)) {
		/* Only CDMA version with TI TPA2018D1 Speaker Amp. */
		i2c_register_board_info(0, rev_CX_i2c_devices,
			ARRAY_SIZE(rev_CX_i2c_devices));
		if ((system_rev & 0x0F) == 0x00) {
			a1026_data.gpio_a1026_clk = MAHIMAHI_CDMA_XA_AUD_A1026_CLK;
		} else if ((system_rev & 0x0F) >= 0x01) {
			a1026_data.gpio_a1026_wakeup = MAHIMAHI_CDMA_XB_AUD_A1026_WAKEUP;
			a1026_data.gpio_a1026_reset = MAHIMAHI_CDMA_XB_AUD_A1026_RESET;
			a1026_data.gpio_a1026_clk = MAHIMAHI_CDMA_XB_AUD_A1026_CLK;
		}
	}

	ret = mahimahi_init_mmc(system_rev, debug_uart);
	if (ret != 0)
		pr_crit("%s: Unable to initialize MMC\n", __func__);

	properties_kobj = kobject_create_and_add("board_properties", NULL);
	if (properties_kobj)
		ret = sysfs_create_group(properties_kobj,
					 &mahimahi_properties_attr_group);
	if (!properties_kobj || ret)
		pr_err("failed to create board_properties\n");

	mahimahi_audio_init();
	mahimahi_headset_init();

	if (system_rev > 0)
		platform_device_register(&mahimahi_timed_gpios);
	else
		msm_init_pmic_vibrator();

	ds2784_battery_init();
}
Пример #15
0
static unsigned int saga_sdslot_status(struct device *dev)
{
    unsigned int status;

    status = (unsigned int) gpio_get_value(SAGA_SDMC_CD_N_SYS);
    return (!status);
}

#define SAGA_MMC_VDD		(MMC_VDD_28_29 | MMC_VDD_29_30)

static unsigned int saga_sdslot_type = MMC_TYPE_SD;

static struct mmc_platform_data saga_sdslot_data = {
    .ocr_mask	= SAGA_MMC_VDD,
    .status_irq	= MSM_GPIO_TO_INT(SAGA_SDMC_CD_N_SYS),
    .status		= saga_sdslot_status,
    .translate_vdd	= saga_sdslot_switchvdd,
    .slot_type	= &saga_sdslot_type,
    .dat0_gpio	= 63,
};

static unsigned int saga_emmcslot_type = MMC_TYPE_MMC;
static struct mmc_platform_data saga_movinand_data = {
    .ocr_mask	= SAGA_MMC_VDD,
    .slot_type	= &saga_emmcslot_type,
    .mmc_bus_width  = MMC_CAP_8_BIT_DATA,
};

/* ---- WIFI ---- */
Пример #16
0
static int __devinit ehci_hsic_msm_probe(struct platform_device *pdev)
{
	struct usb_hcd *hcd;
	struct resource *res;
	struct msm_hsic_hcd *mehci;
	struct msm_hsic_host_platform_data *pdata;
	int ret;

	dev_dbg(&pdev->dev, "ehci_msm-hsic probe\n");

	/* After parent device's probe is executed, it will be put in suspend
	 * mode. When child device's probe is called, driver core is not
	 * resuming parent device due to which parent will be in suspend even
	 * though child is active. Hence resume the parent device explicitly.
	 */
	if (pdev->dev.parent)
		pm_runtime_get_sync(pdev->dev.parent);

	hcd = usb_create_hcd(&msm_hsic_driver, &pdev->dev,
				dev_name(&pdev->dev));
	if (!hcd) {
		dev_err(&pdev->dev, "Unable to create HCD\n");
		return  -ENOMEM;
	}

	hcd_to_bus(hcd)->skip_resume = true;

	hcd->irq = platform_get_irq(pdev, 0);
	if (hcd->irq < 0) {
		dev_err(&pdev->dev, "Unable to get IRQ resource\n");
		ret = hcd->irq;
		goto put_hcd;
	}

	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
	if (!res) {
		dev_err(&pdev->dev, "Unable to get memory resource\n");
		ret = -ENODEV;
		goto put_hcd;
	}

	hcd->rsrc_start = res->start;
	hcd->rsrc_len = resource_size(res);
	hcd->regs = ioremap(hcd->rsrc_start, hcd->rsrc_len);
	if (!hcd->regs) {
		dev_err(&pdev->dev, "ioremap failed\n");
		ret = -ENOMEM;
		goto put_hcd;
	}

	mehci = hcd_to_hsic(hcd);
	mehci->dev = &pdev->dev;
	pdata = mehci->dev->platform_data;

	spin_lock_init(&mehci->wakeup_lock);

	mehci->ehci.susp_sof_bug = 1;
	mehci->ehci.reset_sof_bug = 1;

	mehci->ehci.resume_sof_bug = 1;

	if (pdata)
		mehci->ehci.log2_irq_thresh = pdata->log2_irq_thresh;

	res = platform_get_resource_byname(pdev,
			IORESOURCE_IRQ,
			"peripheral_status_irq");
	if (res)
		mehci->peripheral_status_irq = res->start;

	res = platform_get_resource_byname(pdev, IORESOURCE_IO, "wakeup");
	if (res) {
		mehci->wakeup_gpio = res->start;
		mehci->wakeup_irq = MSM_GPIO_TO_INT(res->start);
		dev_dbg(mehci->dev, "wakeup_irq: %d\n", mehci->wakeup_irq);
	}

	ret = msm_hsic_init_clocks(mehci, 1);
	if (ret) {
		dev_err(&pdev->dev, "unable to initialize clocks\n");
		ret = -ENODEV;
		goto unmap;
	}

	ret = msm_hsic_init_vddcx(mehci, 1);
	if (ret) {
		dev_err(&pdev->dev, "unable to initialize VDDCX\n");
		ret = -ENODEV;
		goto deinit_clocks;
	}

	init_completion(&mehci->rt_completion);
	init_completion(&mehci->gpt0_completion);
	ret = msm_hsic_reset(mehci);
	if (ret) {
		dev_err(&pdev->dev, "unable to initialize PHY\n");
		goto deinit_vddcx;
	}

	ehci_wq = create_singlethread_workqueue("ehci_wq");
	if (!ehci_wq) {
		dev_err(&pdev->dev, "unable to create workqueue\n");
		ret = -ENOMEM;
		goto deinit_vddcx;
	}

	INIT_WORK(&mehci->bus_vote_w, ehci_hsic_bus_vote_w);

	ret = usb_add_hcd(hcd, hcd->irq, IRQF_SHARED);
	if (ret) {
		dev_err(&pdev->dev, "unable to register HCD\n");
		goto unconfig_gpio;
	}

	device_init_wakeup(&pdev->dev, 1);
	wake_lock_init(&mehci->wlock, WAKE_LOCK_SUSPEND, dev_name(&pdev->dev));
	wake_lock(&mehci->wlock);

	if (mehci->peripheral_status_irq) {
		ret = request_threaded_irq(mehci->peripheral_status_irq,
			NULL, hsic_peripheral_status_change,
			IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING
						| IRQF_SHARED,
			"hsic_peripheral_status", mehci);
		if (ret)
			dev_err(&pdev->dev, "%s:request_irq:%d failed:%d",
				__func__, mehci->peripheral_status_irq, ret);
	}

	/* configure wakeup irq */
	if (mehci->wakeup_irq) {
		/* In case if wakeup gpio is pulled high at this point
		 * remote wakeup interrupt fires right after request_irq.
		 * Remote wake up interrupt only needs to be enabled when
		 * HSIC bus goes to suspend.
		 */
		irq_set_status_flags(mehci->wakeup_irq, IRQ_NOAUTOEN);
		ret = request_irq(mehci->wakeup_irq, msm_hsic_wakeup_irq,
				IRQF_TRIGGER_HIGH,
				"msm_hsic_wakeup", mehci);
		if (ret) {
			dev_err(&pdev->dev, "request_irq(%d) failed: %d\n",
					mehci->wakeup_irq, ret);
			mehci->wakeup_irq = 0;
		}
	}

	ret = ehci_hsic_msm_debugfs_init(mehci);
	if (ret)
		dev_dbg(&pdev->dev, "mode debugfs file is"
			"not available\n");

	if (pdata && pdata->bus_scale_table) {
		mehci->bus_perf_client =
		    msm_bus_scale_register_client(pdata->bus_scale_table);
		/* Configure BUS performance parameters for MAX bandwidth */
		if (mehci->bus_perf_client) {
			mehci->bus_vote = true;
			queue_work(ehci_wq, &mehci->bus_vote_w);
		} else {
			dev_err(&pdev->dev, "%s: Failed to register BUS "
						"scaling client!!\n", __func__);
		}
	}

	__mehci = mehci;

	if (pdata && pdata->swfi_latency)
		pm_qos_add_request(&mehci->pm_qos_req_dma,
			PM_QOS_CPU_DMA_LATENCY, PM_QOS_DEFAULT_VALUE);

	/*
	 * This pdev->dev is assigned parent of root-hub by USB core,
	 * hence, runtime framework automatically calls this driver's
	 * runtime APIs based on root-hub's state.
	 */
	pm_runtime_set_active(&pdev->dev);
	pm_runtime_enable(&pdev->dev);
	/* Decrement the parent device's counter after probe.
	 * As child is active, parent will not be put into
	 * suspend mode.
	 */
	if (pdev->dev.parent)
		pm_runtime_put_sync(pdev->dev.parent);

	return 0;

unconfig_gpio:
	destroy_workqueue(ehci_wq);
	msm_hsic_config_gpios(mehci, 0);
deinit_vddcx:
	msm_hsic_init_vddcx(mehci, 0);
deinit_clocks:
	msm_hsic_init_clocks(mehci, 0);
unmap:
	iounmap(hcd->regs);
put_hcd:
	usb_put_hcd(hcd);

	return ret;
}
Пример #17
0
		.platform_data = htcleo_synaptics_ts_data,
		.irq = MSM_GPIO_TO_INT(HTCLEO_GPIO_TP_INT_N)
	},
	{
		I2C_BOARD_INFO("htcleo-microp", 0xCC >> 1),
		.platform_data = &microp_data,
		.irq = MSM_GPIO_TO_INT(HTCLEO_GPIO_UP_INT_N)
	},
	{
		I2C_BOARD_INFO("ds2482", 0x30 >> 1),
		.platform_data = ds2482_set_slp_n,
	},
	{
		I2C_BOARD_INFO(AKM8973_I2C_NAME, 0x1C),
		.platform_data = &compass_platform_data,
		.irq = MSM_GPIO_TO_INT(HTCLEO_GPIO_COMPASS_INT_N),
	},
	{
		I2C_BOARD_INFO("s5k3e2fx", 0x20 >> 1),
	},
	{
		I2C_BOARD_INFO("tps65023", 0x48),
		.platform_data = tps65023_data,
	},
};

static struct i2c_board_info rev_CX_i2c_devices[] = {
	{
		I2C_BOARD_INFO("tpa2018d1", 0x58),
		.platform_data = &tpa2018_data,
	},
Пример #18
0
int Q7x27_kybd_hookswitch_irqsetup(bool activate_irq)
{
	int rc = 0;
    bool  hook_sw_val;

	suspend_state_t SuspendState = PM_SUSPEND_ON;//FIH, KarenLiao, @20090731: [F0X.FC-41]: The action of Inserting headset is the wake up action.

	
    //printk(KERN_INFO "Q7x27_kybd_hookswitch_irqsetup \n"); 
    fih_printk(Q7x27_kybd_debug_mask, FIH_DEBUG_ZONE_G0,"Q7x27_kybd_hookswitch_irqsetup\n");

//+++ FIH, KarenLiao, @20090731: [F0X.FC-41]: The action of Inserting headset is the wake up action.
	SuspendState = get_suspend_state();
	if(SuspendState == PM_SUSPEND_MEM)//3
	{
		if(kpdev)
		{
			input_report_key(kpdev, KEY_RINGSWITCH, KBD_IN_KEYPRESS);
			//printk(KERN_INFO "FIH: keypress KEY_RINGSWITCH = %d\n", KEY_LEFTSHIFT);
			fih_printk(Q7x27_kybd_debug_mask, FIH_DEBUG_ZONE_G0,"FIH: keypress KEY_RINGSWITCH = %d\n",KEY_LEFTSHIFT);
			
			input_report_key(kpdev, KEY_RINGSWITCH, KBD_IN_KEYRELEASE);
			//printk(KERN_INFO "FIH: keyrelease KEY_RINGSWITCH = %d\n", KEY_LEFTSHIFT);
			fih_printk(Q7x27_kybd_debug_mask, FIH_DEBUG_ZONE_G0,"FIH: keyrelease KEY_RINGSWITCH = %d\n",KEY_LEFTSHIFT);
			input_sync(kpdev);
		}
	}
//--- FIH, KarenLiao, @20090731: [F0X.FC-41]: The action of Inserting headset is the wake up action.

	if (activate_irq && (gpio_get_value(rd->hook_sw_pin) == 1)) {

/* FIH, PeterKCTseng, @20090603 { */
/* clear pending interrupt        */
        gpio_clear_detect_status(rd->hook_sw_pin);
   	    hook_sw_val = (bool)gpio_get_value(rd->hook_sw_pin);
  	    //printk(KERN_INFO "Read back hook switch eky <%d>\n", hook_sw_val);
  	    fih_printk(Q7x27_kybd_debug_mask, FIH_DEBUG_ZONE_G0,"Read back hook switch key <%d>\n", hook_sw_val);
        mdelay(250);
/* } FIH, PeterKCTseng, @20090603 */

    	rc = request_irq(MSM_GPIO_TO_INT(rd->hook_sw_pin), &Q7x27_kybd_irqhandler,
			        (IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING), 
			        Q7x27_kybd_name, rd);
	    if (rc < 0) {
    		//printk(KERN_ERR
		    //    "Could not register for  %s interrupt "
		    //    "(rc = %d)\n", Q7x27_kybd_name, rc);
		    fih_printk(Q7x27_kybd_debug_mask, FIH_DEBUG_ZONE_G0,"Could not register for  %s interrupt(rc = %d) \n",Q7x27_kybd_name, rc);
		    rc = -EIO;
	    }
        fih_printk(Q7x27_kybd_debug_mask, FIH_DEBUG_ZONE_G0,"Hook Switch IRQ Enable!\n");
        //printk(KERN_INFO "Hook Switch IRQ Enable! \n");
		rd->bHookSWIRQEnabled = true;
	} else {
		if (rd->bHookSWIRQEnabled)  {
			//printk(KERN_INFO "Free IRQ\n");
    		free_irq(MSM_GPIO_TO_INT(rd->hook_sw_pin), rd);
             fih_printk(Q7x27_kybd_debug_mask, FIH_DEBUG_ZONE_G0,"Hook Switch IRQ disable\n");
            //printk(KERN_INFO "Hook Switch IRQ disable! \n");
			rd->bHookSWIRQEnabled = false;
		}
	}
	
	return rc;

}
Пример #19
0
		else
			wlan_static_skb[i] = dev_alloc_skb(8192);
	}
	for(i=0;( i < PREALLOC_WLAN_NUMBER_OF_SECTIONS );i++) {
		wifi_mem_array[i].mem_ptr = kmalloc(wifi_mem_array[i].size,
							GFP_KERNEL);
		if (wifi_mem_array[i].mem_ptr == NULL)
			return -ENOMEM;
	}
	return 0;
}

static struct resource htcleo_wifi_resources[] = {
	[0] = {
		.name		= "bcm4329_wlan_irq",
		.start		= MSM_GPIO_TO_INT(HTCLEO_GPIO_WIFI_IRQ),
		.end		= MSM_GPIO_TO_INT(HTCLEO_GPIO_WIFI_IRQ),
		.flags          = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
	},
};

static struct wifi_platform_data htcleo_wifi_control = {
	.set_power      = htcleo_wifi_power,
	.set_reset      = htcleo_wifi_reset,
	.set_carddetect = htcleo_wifi_set_carddetect,
	.mem_prealloc   = htcleo_wifi_mem_prealloc,
};

static struct platform_device htcleo_wifi_device = {
        .name           = "bcm4329_wlan",
        .id             = 1,
Пример #20
0
static void Q7x27_kybd_volkey2(struct work_struct *work)
{
	struct Q7x27_kybd_record *kbdrec= container_of(work, struct Q7x27_kybd_record, kybd_volkey2);
	struct input_dev *idev		= kbdrec->Q7x27_kybd_idev;
	bool debounceDelay		= false;
	
	bool voldn_val			= (bool)gpio_get_value(kbdrec->voldn_pin);
	//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++misty
	suspend_state_t SuspendState = PM_SUSPEND_ON;//0
	//-----------------------------------------------------------------misty
/* FIH, PeterKCTseng, @20090520 { */
/* The active type of input pin   */
#if ACTIVE_MODE_ENABLE // Peter, Debug
	bool state;
#endif
/* } FIH, PeterKCTseng, @20090520 */
    //fih_printk(Q7x27_kybd_debug_mask, FIH_DEBUG_ZONE_G0,"[Misty]VOL DN <%d>\n", voldn_val);
	//printk(KERN_INFO "VOL DN <%d>\n", voldn_val);

	disable_irq(MSM_GPIO_TO_INT(kbdrec->voldn_pin));
//+++++++++++++++++++++++++++++++FIH_F0X_misty
    if(EnableKeyInt)
    {
        SuspendState = get_suspend_state();
        if(SuspendState == PM_SUSPEND_MEM)
        {
            if(idev)
            {
            	input_report_key(idev, KEY_VOLUMEDOWN, KBD_IN_KEYPRESS);
            		//printk(KERN_INFO "FIH: keypress KEY_VOLUMEDOWN\n");
            		fih_printk(Q7x27_kybd_debug_mask, FIH_DEBUG_ZONE_G0,"FIH: keypress KEY_VOLUMEDOWNP\n");
            	input_report_key(idev, KEY_VOLUMEDOWN, KBD_IN_KEYRELEASE);
            		//printk(KERN_INFO "FIH: keyrelease KEY_VOLUMEDOWN\n");
            		fih_printk(Q7x27_kybd_debug_mask, FIH_DEBUG_ZONE_G0,"FIH: keyrelease KEY_VOLUMEDOWN\n");
            	input_sync(idev);
            }
        }
        //-------------------------------FIH_F0X_misty
        else
        {
        /* FIH, PeterKCTseng, @20090520 { */
        /* The active type of input pin   */
        #if ACTIVE_MODE_ENABLE // Peter, Debug
            state = (kbdrec->active.voldn_pin_actype == ACTIVE_HIGH) ? voldn_val : !voldn_val;
        	//printk(KERN_INFO "active type= %d \n", state);
        #endif
        /* } FIH, PeterKCTseng, @20090520 */
            if(idev)
            {
            	if (state) {
            		input_report_key(idev, KEY_VOLUMEDOWN, KBD_IN_KEYPRESS);
            		//printk(KERN_INFO "FIH: keypress KEY_VOLUMEDOWN\n");
            		fih_printk(Q7x27_kybd_debug_mask, FIH_DEBUG_ZONE_G0,"FIH: keypress KEY_VOLUMEDOWN\n");
        // FIH, WillChen, 2009/08/14 ++
        //Press VolumeUp+VolumeDown+End key to force panic and dump log
        #ifdef CONFIG_FIH_FXX_FORCEPANIC
            		VDN_Key = true;
            		if (VUP_Key && VDN_Key && END_key)
            		{
            			printk(KERN_ERR "KPD: Three key panic!!\n");
            			flag = 1;
        				wake_up(&wq);
        				msleep(5000);
        				panic("Three key panic");
        			}
        #endif
        // FIH, WillChen, 2009/08/14 --
            	} else {
            		input_report_key(idev, KEY_VOLUMEDOWN, KBD_IN_KEYRELEASE);
            		//printk(KERN_INFO "FIH: keyrelease KEY_VOLUMEDOWN\n");		
            		fih_printk(Q7x27_kybd_debug_mask, FIH_DEBUG_ZONE_G0,"FIH: keyrelease KEY_VOLUMEDOWN\n");
            		debounceDelay = true;
        // FIH, WillChen, 2009/08/14 ++
        //Press VolumeUp+VolumeDown+End key to force panic and dump log
        #ifdef CONFIG_FIH_FXX_FORCEPANIC
            		VDN_Key = false;
        #endif
        // FIH, WillChen, 2009/08/14 --
            	}
            
            	input_sync(idev);
            			//printk(KERN_INFO "FIH: keypress KEY_VOLUMEDOWN\n");	
            			fih_printk(Q7x27_kybd_debug_mask, FIH_DEBUG_ZONE_G0,"FIH: keypress KEY_VOLUMEDOWN\n");
            }	
        
        	if (debounceDelay) {
        		mdelay(KBD_DEBOUNCE_TIME); //Debounce
        	}
         }
    }//if(EnableKeyInt)
	enable_irq(MSM_GPIO_TO_INT(kbdrec->voldn_pin));
}
    .disp_minx		= 0,
    .disp_maxx		= 479,
    .disp_miny		= 0,
    .disp_maxy		= 799,
    .irqflags		= IRQF_TRIGGER_LOW,
    .i2c_pull_up		= true,
    .reset_gpio		= MXT_TS_RESET_GPIO,
    .irq_gpio		= MXT_TS_IRQ_GPIO,
    .key_codes		= mxt_key_codes,
};

static struct i2c_board_info mxt_device_info[] __initdata = {
    {
        I2C_BOARD_INFO("atmel_mxt_ts", 0x4a),
        .platform_data = &mxt_platform_data,
        .irq = MSM_GPIO_TO_INT(MXT_TS_IRQ_GPIO),
    },
};

static int synaptics_touchpad_setup(void);

static struct msm_gpio clearpad3000_cfg_data[] = {
    {   GPIO_CFG(CLEARPAD3000_ATTEN_GPIO, 0, GPIO_CFG_INPUT,
        GPIO_CFG_NO_PULL, GPIO_CFG_6MA), "rmi4_attn"
    },
    {   GPIO_CFG(CLEARPAD3000_RESET_GPIO, 0, GPIO_CFG_OUTPUT,
        GPIO_CFG_PULL_DOWN, GPIO_CFG_8MA), "rmi4_reset"
    },
};

static struct rmi_XY_pair rmi_offset = {.x = 0, .y = 0};
Пример #22
0
//---------------------------FIH_F0X_misty
static int Q7x27_kybd_probe(struct platform_device *pdev)
{
	struct Q7x27_kybd_platform_data *setup_data;
	int rc = -ENOMEM;

/* FIH, PeterKCTseng, @20090520 { */
/* The active type of input pin   */
#if ACTIVE_MODE_ENABLE // Peter, Debug
    g_HWID = FIH_READ_HWID_FROM_SMEM();
    g_ORIGHWID = FIH_READ_ORIG_HWID_FROM_SMEM();
#endif
/* } FIH, PeterKCTseng, @20090520 */

    //FIH_debug_log
    fih_printk(Q7x27_kybd_debug_mask, FIH_DEBUG_ZONE_G0,"Q7x27_kybd_probe\n");
    //printk(KERN_INFO "FIH: enter Q7x27_kybd_probe()\n");
	rd = kzalloc(sizeof(struct Q7x27_kybd_record), GFP_KERNEL);
	if (!rd) {
		//printk(KERN_ERR "i2ckybd_record memory allocation failed!!\n");
		fih_printk(Q7x27_kybd_debug_mask, FIH_DEBUG_ZONE_G0,"kybd_record memory allocation failed!!\n");
		return rc;
	}

	setup_data 		    = pdev->dev.platform_data;
	//+++++++++++++++++++++++++++FIH_F0X_misty
	//printk(KERN_ERR "++++++++++++++++++++++++add init_wakeup\n");
	device_init_wakeup(&pdev->dev, 1);
	//printk(KERN_ERR "---------------------add init_wakeup\n");
	//------------------------------FIH_F0X_misty
/* FIH, PeterKCTseng, @20090520 { */
/* The active type of input pin   */
#if ACTIVE_MODE_ENABLE // Peter, Debug
    
     if (g_HWID >= CMCS_RTP_PR1) {
		//printk(KERN_ERR "FIH: CMCS_RTP_PR1, g_HWID= %d \n", g_HWID);
		fih_printk(Q7x27_kybd_debug_mask, FIH_DEBUG_ZONE_G0,"FIH: CMCS_RTP_PR1, g_HWID= %d\n", g_HWID);
        rd->active.volup_pin_actype     = ACTIVE_HIGH;
        rd->active.voldn_pin_actype     = ACTIVE_HIGH;
        rd->active.hook_sw_pin_actype   = ACTIVE_LOW;

    }          
    else {
        // target board undefined 
		//printk(KERN_ERR "target borad can not be recognized!! \n");
		fih_printk(Q7x27_kybd_debug_mask, FIH_DEBUG_ZONE_G0,"target borad can not be recognized!!\n");

    }  
#endif
/* } FIH, PeterKCTseng, @20090520 */

#if VOLUME_KEY_ENABLE // Peter, Debug
	rd->volup_pin		= setup_data->volup_pin;
	rd->voldn_pin		= setup_data->voldn_pin;
#endif


#if SWITCH_KEY_ENABLE // Peter, Debug
	rd->hook_sw_pin     = setup_data->hook_sw_pin;

/* FIH, PeterKCTseng, @20090603 { */
	rd->bHookSWIRQEnabled = false; //FIH, KarenLiao, @20100520: FM6.B-706: Set initial value of HookSWIRQEnabled to false to fix calling enable_irq_wake() without headset.
/* } FIH, PeterKCTseng, @20090603 */
#endif


	//Initialize GPIO
	rc = Q7x27_kybd_config_gpio(rd);
	if (rc)
		goto failexit1;


#if VOLUME_KEY_ENABLE // Peter, Debug
	INIT_WORK(&rd->kybd_volkey1, Q7x27_kybd_volkey1);
    INIT_WORK(&rd->kybd_volkey2, Q7x27_kybd_volkey2);
#endif


#if SWITCH_KEY_ENABLE // Peter, Debug
	INIT_WORK(&rd->hook_switchkey, Q7x27_hook_switchkey);


//  msm_mic_en_proc(true);

#endif

    KeySetup();

    /* FIH, Debbie, 2010/01/05 { */
    /* modify for key definition of OTA update*/
    if(fih_read_kpd_from_smem())
    {
    	   EnableKeyInt = 1;
    }
    /* FIH, Debbie, 2010/01/05 } */
#if 0//misty +++
    printk(KERN_INFO "FIH: enter 7\n");    
	rc = Q7x27_kybd_irqsetup(rd);
    printk(KERN_INFO "FIH: enter 8\n");        
	if (rc)
		goto failexit2;

	rc = testfor_keybd();
    printk(KERN_INFO "FIH: enter 9\n");    
	if (rc)
		goto failexit2;
	
	rd->kybd_connected = 1;
#endif//misty ---
/* FIH, SimonSSChang, 2009/09/04 { */
/* [FXX_CR], change keypad suspend/resume function
to earlysuspend */
#ifdef CONFIG_FIH_FXX
#ifdef CONFIG_HAS_EARLYSUSPEND
    rd->Q7x27_kybd_early_suspend_desc.level = EARLY_SUSPEND_LEVEL_BLANK_SCREEN - 10;
	rd->Q7x27_kybd_early_suspend_desc.suspend = Q7x27_kybd_early_suspend;
	rd->Q7x27_kybd_early_suspend_desc.resume = Q7x27_kybd_late_resume;
    //printk(KERN_INFO "Keypad register_early_suspend()\n");
    fih_printk(Q7x27_kybd_debug_mask, FIH_DEBUG_ZONE_G0,"Keypad register_early_suspend()\n");
	register_early_suspend(&rd->Q7x27_kybd_early_suspend_desc);
    rd->pdev = pdev;
#endif
#endif
/* } FIH, SimonSSChang, 2009/09/04 */

    //FIH_debug_log
    //printk(KERN_INFO "FIH: out Q7x27_kybd_probe()\n");
    return 0;
#if 0//misty+++
 failexit2:
    //FIH_debug_log#if CAMERA_KEY_ENABLE // Peter, Debug

    printk(KERN_INFO "FIH: error out failexit2\n");
    
	free_irq(MSM_GPIO_TO_INT(rd->key_1_pin), rd);
	free_irq(MSM_GPIO_TO_INT(rd->key_2_pin), rd);

#if VOLUME_KEY_ENABLE // Peter, Debug
	free_irq(MSM_GPIO_TO_INT(rd->volup_pin), rd);
	free_irq(MSM_GPIO_TO_INT(rd->voldn_pin), rd);
#endif

#if CAMERA_KEY_ENABLE // Peter, Debug
	free_irq(MSM_GPIO_TO_INT(rd->cam_sw_t_pin), rd);
	free_irq(MSM_GPIO_TO_INT(rd->cam_sw_f_pin), rd);
#endif

#if SWITCH_KEY_ENABLE // Peter, Debug
	free_irq(MSM_GPIO_TO_INT(rd->hook_sw_pin), rd);
#endif

/* FIH, PeterKCTseng, @20090527 { */
/* add center key                 */
#if CENTER_KEY_ENABLE // Peter, Debug
	free_irq(MSM_GPIO_TO_INT(rd->center_pin), rd);
#endif
/* } FIH, PeterKCTseng, @20090527 */

#endif//misty----
 failexit1:
    //FIH_debug_log
    //printk(KERN_INFO "FIH: error out failexit1\n");
    fih_printk(Q7x27_kybd_debug_mask, FIH_DEBUG_ZONE_G0,"FIH: error out failexit1\n");
	Q7x27_kybd_release_gpio(rd);
	kfree(rd);

    //FIH_debug_log
    //printk(KERN_INFO "FIH: error out Q7x27_kybd_probe()\n");
    return 0;
    
	return rc;
}
Пример #23
0
static unsigned int heroc_sdslot_status(struct device *dev)
{
	unsigned int status;

	status = (unsigned int) gpio_get_value(HEROC_GPIO_SDMC_CD_N);
	return (!status);
}

#define HEROC_MMC_VDD	MMC_VDD_27_28 | MMC_VDD_28_29 | MMC_VDD_29_30

static unsigned int heroc_sdslot_type = MMC_TYPE_SD;

static struct mmc_platform_data heroc_sdslot_data = {
	.ocr_mask	= HEROC_MMC_VDD,
	.status_irq	= MSM_GPIO_TO_INT(HEROC_GPIO_SDMC_CD_N),
	.status		= heroc_sdslot_status,
	.translate_vdd	= heroc_sdslot_switchvdd,
	.slot_type	= &heroc_sdslot_type,
};



/* ---- WIFI ---- */

static uint32_t wifi_on_gpio_table[] = {
	PCOM_GPIO_CFG(51, 1, GPIO_OUTPUT, GPIO_PULL_UP, GPIO_4MA), /* DAT3 */
	PCOM_GPIO_CFG(52, 1, GPIO_OUTPUT, GPIO_PULL_UP, GPIO_4MA), /* DAT2 */
	PCOM_GPIO_CFG(53, 1, GPIO_OUTPUT, GPIO_PULL_UP, GPIO_4MA), /* DAT1 */
	PCOM_GPIO_CFG(54, 1, GPIO_OUTPUT, GPIO_PULL_UP, GPIO_4MA), /* DAT0 */
	PCOM_GPIO_CFG(55, 1, GPIO_OUTPUT, GPIO_PULL_UP, GPIO_8MA), /* CMD */
Пример #24
0
}
#endif

/* LGE_CHANGE_S [[email protected]] 2010-04-24, BCM4325 control gpio */
#if defined(CONFIG_LGE_BCM432X_PATCH)
static unsigned int bcm432x_sdcc_wlan_slot_status(struct device *dev)
{
	printk(KERN_ERR "%s: %d %d\n", __func__, CONFIG_BCM4325_GPIO_WL_RESET, gpio_get_value(CONFIG_BCM4325_GPIO_WL_RESET));
    return gpio_get_value(CONFIG_BCM4325_GPIO_WL_RESET);
}

static struct mmc_platform_data bcm432x_sdcc_wlan_data = {
    .ocr_mask   	= MMC_VDD_30_31,
	.translate_vdd	= msm_sdcc_setup_power,
    .status     	= bcm432x_sdcc_wlan_slot_status,
	.status_irq		= MSM_GPIO_TO_INT(CONFIG_BCM4325_GPIO_WL_RESET),
    .irq_flags      = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
    .mmc_bus_width  = MMC_CAP_4_BIT_DATA,
	.msmsdcc_fmin	= 144000,
	.msmsdcc_fmid	= 24576000,
	.msmsdcc_fmax	= 49152000,
	.nonremovable	= 1,
};
#endif  /* CONFIG_LGE_BCM432X_PATCH*/
/* LGE_CHANGE_E [[email protected]] 2010-04-24, BCM4325 control gpio */

static struct mmc_platform_data msm7x2x_sdcc_data = {
#ifdef CONFIG_MMC_MSM_CARD_HW_DETECTION
	.ocr_mask		= MMC_VDD_30_31,
	.translate_vdd	= msm_sdcc_setup_power,
	.status 		= elini_sdcc_slot_status,
}

#define MHL_SII8334_IRQ_GPIO 35
#define MHL_SII8334_RESET_GPIO 58

static struct sii8334_platform_data mhl_sii8334_data = {
	.gpio_irq = MHL_SII8334_IRQ_GPIO,
	.gpio_reset = MHL_SII8334_RESET_GPIO,
	.core_power = mhl_core_power,
	.enable_5v = mhl_enable_5v,
};

static struct i2c_board_info mhl_sii8334_info[] __initdata = {
	{
		I2C_BOARD_INFO(MHL_SII8334_DRIVER_NAME, 0x72 >> 1),
		.irq		=  MSM_GPIO_TO_INT(MHL_SII8334_IRQ_GPIO),
		.platform_data = &mhl_sii8334_data,
	},
};
#endif

#ifdef CONFIG_FB_MSM_WRITEBACK_MSM_PANEL
static struct platform_device wfd_panel_device = {
	.name = "wfd_panel",
	.id = 0,
	.dev.platform_data = NULL,
};

static struct platform_device wfd_device = {
	.name          = "msm_wfd",
	.id            = -1,
Пример #26
0
void mdp_config_vsync(struct msm_fb_data_type *mfd)
{
	/* vsync on primary lcd only for now */
	if ((mfd->dest != DISPLAY_LCD) || (mfd->panel_info.pdest != DISPLAY_1)
	    || (!vsync_mode)) {
		goto err_handle;
	}

	vsync_clk_status = 0;
	if (mfd->panel_info.lcd.vsync_enable) {
		mfd->total_porch_lines = mfd->panel_info.lcd.v_back_porch +
		    mfd->panel_info.lcd.v_front_porch +
		    mfd->panel_info.lcd.v_pulse_width;
		mfd->total_lcd_lines =
		    mfd->panel_info.yres + mfd->total_porch_lines;
		mfd->lcd_ref_usec_time =
		    100000000 / mfd->panel_info.lcd.refx100;
		mfd->vsync_handler_pending = FALSE;
		mfd->last_vsync_timetick.tv.sec = 0;
		mfd->last_vsync_timetick.tv.nsec = 0;

#ifdef MDP_HW_VSYNC
		if (mdp_vsync_clk == NULL)
			mdp_vsync_clk = clk_get(NULL, "mdp_vsync_clk");

		if (IS_ERR(mdp_vsync_clk)) {
			printk(KERN_ERR "error: can't get mdp_vsync_clk!\n");
			mfd->use_mdp_vsync = 0;
		} else
			mfd->use_mdp_vsync = 1;

		if (mfd->use_mdp_vsync) {
			uint32 vsync_cnt_cfg, vsync_cnt_cfg_dem;
			uint32 mdp_vsync_clk_speed_hz;

			mdp_vsync_clk_speed_hz = clk_get_rate(mdp_vsync_clk);

			if (mdp_vsync_clk_speed_hz == 0) {
				mfd->use_mdp_vsync = 0;
			} else {
				/*
				 * Do this calculation in 2 steps for
				 * rounding uint32 properly.
				 */
				vsync_cnt_cfg_dem =
				    (mfd->panel_info.lcd.refx100 *
				     mfd->total_lcd_lines) / 100;
				vsync_cnt_cfg =
				    (mdp_vsync_clk_speed_hz) /
				    vsync_cnt_cfg_dem;

				/* MDP cmd block enable */
				mdp_pipe_ctrl(MDP_CMD_BLOCK, MDP_BLOCK_POWER_ON,
					      FALSE);
				mdp_hw_vsync_clk_enable(mfd);

				mdp_set_sync_cfg_0(mfd, vsync_cnt_cfg);


#ifdef CONFIG_FB_MSM_MDP40
				if (mdp_hw_revision < MDP4_REVISION_V2_1)
					mdp_set_sync_cfg_1(mfd, vsync_cnt_cfg);
#endif

				/*
				 * load the last line + 1 to be in the
				 * safety zone
				 */
				vsync_load_cnt = mfd->panel_info.yres;

				/* line counter init value at the next pulse */
				MDP_OUTP(MDP_BASE + MDP_PRIM_VSYNC_INIT_VAL,
							vsync_load_cnt);
#ifdef CONFIG_FB_MSM_MDP40
				if (mdp_hw_revision < MDP4_REVISION_V2_1) {
					MDP_OUTP(MDP_BASE +
					MDP_SEC_VSYNC_INIT_VAL, vsync_load_cnt);
				}
#endif

				/*
				 * external vsync source pulse width and
				 * polarity flip
				 */
				MDP_OUTP(MDP_BASE + MDP_PRIM_VSYNC_OUT_CTRL,
							BIT(0));
#ifdef CONFIG_FB_MSM_MDP40
				if (mdp_hw_revision < MDP4_REVISION_V2_1) {
					MDP_OUTP(MDP_BASE +
					MDP_SEC_VSYNC_OUT_CTRL, BIT(0));
					MDP_OUTP(MDP_BASE +
						MDP_VSYNC_SEL, 0x20);
				}
#endif

				/* threshold */
				MDP_OUTP(MDP_BASE + 0x200,
					 (vsync_above_th << 16) |
					 (vsync_start_th));

				mdp_hw_vsync_clk_disable(mfd);
				/* MDP cmd block disable */
				mdp_pipe_ctrl(MDP_CMD_BLOCK,
					      MDP_BLOCK_POWER_OFF, FALSE);
			}
		}
#else
		mfd->use_mdp_vsync = 0;
		hrtimer_init(&mfd->dma_hrtimer, CLOCK_MONOTONIC,
			     HRTIMER_MODE_REL);
		mfd->dma_hrtimer.function = mdp_dma2_vsync_hrtimer_handler;
		mfd->vsync_width_boundary = vmalloc(mfd->panel_info.xres * 4);
#endif

#ifdef CONFIG_FB_MSM_MDDI
		mfd->channel_irq = 0;
		if (mfd->panel_info.lcd.hw_vsync_mode) {
			u32 vsync_gpio = mfd->vsync_gpio;
			u32 ret;

			if (vsync_gpio == -1) {
				MSM_FB_INFO("vsync_gpio not defined!\n");
				goto err_handle;
			}

			ret = gpio_tlmm_config(GPIO_CFG
					(vsync_gpio,
					(mfd->use_mdp_vsync) ? 1 : 0,
					GPIO_INPUT,
					GPIO_PULL_DOWN,
					GPIO_2MA),
					GPIO_ENABLE);
			if (ret)
				goto err_handle;

			/*
			 * if use_mdp_vsync, then no interrupt need since
			 * mdp_vsync is feed directly to mdp to reset the
			 * write pointer counter. therefore no irq_handler
			 * need to reset write pointer counter.
			 */
			if (!mfd->use_mdp_vsync) {
				mfd->channel_irq = MSM_GPIO_TO_INT(vsync_gpio);
				if (request_irq
				    (mfd->channel_irq,
				     &mdp_hw_vsync_handler_proxy,
				     IRQF_TRIGGER_FALLING, "VSYNC_GPIO",
				     (void *)mfd)) {
					MSM_FB_INFO
					("irq=%d failed! vsync_gpio=%d\n",
						mfd->channel_irq,
						vsync_gpio);
					goto err_handle;
				}
			}
		}
#endif
		mdp_hw_vsync_clk_enable(mfd);
		mdp_set_vsync((unsigned long)mfd);
	}

	return;

err_handle:
	if (mfd->vsync_width_boundary)
		vfree(mfd->vsync_width_boundary);
	mfd->panel_info.lcd.vsync_enable = FALSE;
	printk(KERN_ERR "%s: failed!\n", __func__);
}
		// Only a dummy
		I2C_BOARD_INFO(LEO_TOUCH_DRV_NAME, 0x22),
	},
	{
		I2C_BOARD_INFO("tps65023", 0x48),
		.platform_data = tps65023_data,
	},
	{
		I2C_BOARD_INFO(MICROP_I2C_NAME, 0xCC >> 1),
		.platform_data = &microp_data,
		.irq = MSM_GPIO_TO_INT(HTCLEO_GPIO_UP_INT_N)
	},
	{
		I2C_BOARD_INFO(AKM8973_I2C_NAME, 0x1C),
		.platform_data = &compass_platform_data,
		.irq = MSM_GPIO_TO_INT(HTCLEO_GPIO_COMPASS_INT_N),
	},
	{
	        I2C_BOARD_INFO("s5k3e2fx", 0x20 >> 1),
	},
};

///////////////////////////////////////////////////////////////////////
// USB 
///////////////////////////////////////////////////////////////////////

static uint32_t usb_phy_3v3_table[] =
{
    PCOM_GPIO_CFG(HTCLEO_GPIO_USBPHY_3V3_ENABLE, 0, GPIO_OUTPUT, GPIO_NO_PULL, GPIO_4MA)
};
Пример #28
0
#include <linux/usb/android_composite.h>

#include "board-swordfish.h"
#include "devices.h"
#include "proc_comm.h"

extern int swordfish_init_mmc(void);

static struct resource smc91x_resources[] = {
	[0] = {
		.start	= 0x70000300,
		.end	= 0x70000400,
		.flags	= IORESOURCE_MEM,
	},
	[1] = {
		.start	= MSM_GPIO_TO_INT(156),
		.end	= MSM_GPIO_TO_INT(156),
		.flags	= IORESOURCE_IRQ,
	},
};

static struct platform_device smc91x_device = {
	.name		= "smc91x",
	.id		= 0,
	.num_resources	= ARRAY_SIZE(smc91x_resources),
	.resource	= smc91x_resources,
};

static int swordfish_phy_init_seq[] = {
	0x0C, 0x31,
	0x1D, 0x0D,
	printk(KERN_INFO "%s: start (ccode:%s)\n", __func__, ccode);

#if 0
	for (i = 0; i < size; i++)
		if (!strcmp(ccode,
			msm7x30_wifi_translate_custom_table[i].iso_abbrev))
			return &msm7x30_wifi_translate_custom_table[i];
#endif
	return &msm7x30_wifi_translate_custom_table[0];
}

static struct resource msm7x30_wifi_resources[] = {
	[0] = {
		.name	= "bcmdhd_wlan_irq",
		.start	= MSM_GPIO_TO_INT(GPIO_WLAN_IRQ),
		.end	= MSM_GPIO_TO_INT(GPIO_WLAN_IRQ),
		.flags	= IORESOURCE_IRQ |
			  IORESOURCE_IRQ_HIGHLEVEL |
			  IORESOURCE_IRQ_SHAREABLE,
	},
};

static struct wifi_platform_data msm7x30_wifi_control = {
	.set_power	= msm7x30_wifi_power,
	.set_carddetect	= msm7x30_wifi_set_carddetect,
	.get_mac_addr	= msm7x30_wifi_get_mac_addr,
	.get_country_code	= msm7x30_wifi_get_country_code,
};

static struct platform_device msm7x30_wifi_device = {
static void __init liberty_init(void)
{
    int rc;
    char *cid = NULL;
    struct kobject *properties_kobj;

    printk("liberty_init() revision = 0x%X\n", system_rev);
    board_get_cid_tag(&cid);

    /* for bcm */
    bt_export_bd_address();

    /*
     * Setup common MSM GPIOS
     */
    config_gpios();

    /* We need to set this pin to 0 only once on power-up; we will
     * not actually enable the chip until we apply power to it via
     * vreg.
     */
    gpio_request(LIBERTY_GPIO_LS_EN, "ls_en");
    gpio_direction_output(LIBERTY_GPIO_LS_EN, 0);
    /* disable power for cm3602 chip */
    /* __capella_cm3602_power(0); */

    msm_hw_reset_hook = liberty_reset;

    msm_acpu_clock_init(&liberty_clock_data);
    perflock_init(&liberty_perflock_data);

#if defined(CONFIG_MSM_SERIAL_DEBUGGER)
    if (!opt_disable_uart3)
        msm_serial_debug_init(MSM_UART3_PHYS, INT_UART3,
                              &msm_device_uart3.dev, 1,
                              MSM_GPIO_TO_INT(LIBERTY_GPIO_UART3_RX));
#endif

    msm_add_devices();

#ifdef CONFIG_SERIAL_MSM_HS
    msm_device_uart_dm1.dev.platform_data = &msm_uart_dm1_pdata;
    msm_device_uart_dm1.name = "msm_serial_hs_bcm";	/* for bcm */
    msm_add_serial_devices(3);
#else
    msm_add_serial_devices(0);
#endif

    msm_add_serial_devices(2);
    /*
    msm_change_usb_id(0x0bb4, 0x0c10);
    */
#ifdef CONFIG_USB_FUNCTION
    msm_add_usb_id_pin_gpio(LIBERTY_GPIO_USB_ID_PIN);
    msm_add_usb_devices(liberty_phy_reset, NULL);
#endif

#ifdef CONFIG_USB_ANDROID
    android_usb_pdata.products[0].product_id =
        android_usb_pdata.product_id;
    android_usb_pdata.serial_number = board_serialno();
    msm_hsusb_pdata.serial_number = board_serialno();
    msm_device_hsusb.dev.platform_data = &msm_hsusb_pdata;
    platform_device_register(&msm_device_hsusb);
    platform_device_register(&usb_mass_storage_device);
    platform_device_register(&android_usb_device);
#endif
    msm_add_mem_devices(&pmem_setting);

#ifdef CONFIG_MICROP_COMMON
    liberty_microp_init();
#endif

    rc = liberty_init_mmc(system_rev);
    if (rc)
        printk(KERN_CRIT "%s: MMC init failure (%d)\n", __func__, rc);

    properties_kobj = kobject_create_and_add("board_properties", NULL);
    if (properties_kobj)
        rc = sysfs_create_group(properties_kobj,
                                &liberty_properties_attr_group);
    if (!properties_kobj || rc)
        pr_err("failed to create board_properties\n");

    /* probe camera driver */
    i2c_register_board_info(0, i2c_camera_devices, ARRAY_SIZE(i2c_camera_devices));

    msm_device_i2c_init();
    platform_add_devices(devices, ARRAY_SIZE(devices));
    i2c_register_board_info(0, i2c_devices, ARRAY_SIZE(i2c_devices));

    liberty_init_panel();

    liberty_init_keypad();
}