示例#1
0
static void omap4_mapphone_wifi_init(void)
{
	int ret;
	mapphone_wifi_pmena_gpio = get_gpio_by_name("wlan_pmena");
	mapphone_wifi_irq_gpio = get_gpio_by_name("wlan_irqena");
	ret = gpio_request(mapphone_wifi_pmena_gpio, "wifi_pmena");
	if (ret < 0)
		goto out;
	gpio_direction_output(mapphone_wifi_pmena_gpio, 0);
	omap4_mapphone_wlan_data.irq = OMAP_GPIO_IRQ(mapphone_wifi_irq_gpio);
	if (wl12xx_set_platform_data(&omap4_mapphone_wlan_data))
		pr_err("Error setting wl12xx data\n");
out:
	return;
}
示例#2
0
static void __init omap3beagle_ks8851_init(void)
{
	if ((gpio_request(OMAP3BEAGLE_GPIO_KS8851_IRQ, "KS8851_IRQ") == 0) &&
	    (gpio_direction_input(OMAP3BEAGLE_GPIO_KS8851_IRQ) == 0)) {
		gpio_export(OMAP3BEAGLE_GPIO_KS8851_IRQ, 0);
		omap3beagle_zippy2_spi_board_info[0].irq	= OMAP_GPIO_IRQ(OMAP3BEAGLE_GPIO_KS8851_IRQ);
		set_irq_type(omap3beagle_zippy2_spi_board_info[0].irq, IRQ_TYPE_EDGE_FALLING);
	} else {
		printk(KERN_ERR "could not obtain gpio for KS8851_IRQ\n");
		return;
	}

	spi_register_board_info(omap3beagle_zippy2_spi_board_info,
							ARRAY_SIZE(omap3beagle_zippy2_spi_board_info));
}
示例#3
0
int __init ads7846_dev_init(void)
{
	const struct archos_tsp_config *tsp_cfg;
	tsp_cfg = omap_get_config( ARCHOS_TAG_TSP, struct archos_tsp_config );
	/* might be NULL */
	if (tsp_cfg == NULL) {
		printk(KERN_DEBUG "ads7846_dev_init: no board configuration found\n");
		return -ENODEV;
	}
	if ( hardware_rev >= tsp_cfg->nrev ) {
		printk(KERN_DEBUG "ads7846_dev_init: hardware_rev (%i) >= nrev (%i)\n",
			hardware_rev, tsp_cfg->nrev);
		return -ENODEV;
	}

	ts_irq = tsp_cfg->rev[hardware_rev].irq_gpio;
	ts_pwron = tsp_cfg->rev[hardware_rev].pwr_gpio;

	tsc2046_config.x_plate_ohms = tsp_cfg->rev[hardware_rev].x_plate_ohms;
	tsc2046_config.pressure_max = tsp_cfg->rev[hardware_rev].pressure_max;
	tsc2046_config.inversion_flags = tsp_cfg->rev[hardware_rev].inversion_flags;

	if (tsp_cfg->rev[hardware_rev].bus_num != 0)
		ts_spi_board_info[0].bus_num = tsp_cfg->rev[hardware_rev].bus_num;

	if (tsp_cfg->rev[hardware_rev].bus_num == 2) {
		// TODO: muxes for a28, a35.
		BUG();
		//omap_cfg_reg(AA3_3430_MCSPI2_CLK);
		//omap_cfg_reg(Y2_3430_MCSPI2_SIMO);
		//omap_cfg_reg(Y3_3430_MCSPI2_SOMI);
		//omap_cfg_reg(Y4_3430_MCSPI2_CS0);
	}

	printk(KERN_DEBUG "ads7846_dev_init: irq_gpio %i, pwr_gpio %i\n",
			ts_irq.nb, ts_pwron.nb);

	archos_gpio_init_output(&ts_pwron, "ts_pwron");
	tsc2046_config.gpio_pendown = GPIO_PIN(ts_irq);
	ads7846_vaux_control( VAUX_DISABLE );

	/* fix spi irq gio nb */
	ts_spi_board_info[0].irq = OMAP_GPIO_IRQ(GPIO_PIN(ts_irq));
	spi_register_board_info(ts_spi_board_info, 1);

	return 0;
}
int dhd_customer_oob_irq_map(unsigned long *irq_flags_ptr)
{
	int  host_oob_irq = 0;
	//&*&*&*JohWan1 mod BCM4329 OOB support

	#if 0

#ifdef CUSTOMER_HW2
	host_oob_irq = wifi_get_irq_number(irq_flags_ptr);

#else /* for NOT  CUSTOMER_HW2 */
#if defined(CUSTOM_OOB_GPIO_NUM)
	if (dhd_oob_gpio_num < 0) {
		dhd_oob_gpio_num = CUSTOM_OOB_GPIO_NUM;
	}
#endif

	if (dhd_oob_gpio_num < 0) {
		WL_ERROR(("%s: ERROR customer specific Host GPIO is NOT defined \n",
			__FUNCTION__));
		return (dhd_oob_gpio_num);
	}

	WL_ERROR(("%s: customer specific Host GPIO number is (%d)\n",
	         __FUNCTION__, dhd_oob_gpio_num));

#if defined CUSTOMER_HW
	host_oob_irq = MSM_GPIO_TO_INT(dhd_oob_gpio_num);
#elif defined CUSTOMER_HW3
	gpio_request(dhd_oob_gpio_num, "oob irq");
	host_oob_irq = gpio_to_irq(dhd_oob_gpio_num);
	gpio_direction_input(dhd_oob_gpio_num);
#endif /* CUSTOMER_HW */
#endif /* CUSTOMER_HW2 */

	#else //if 0
	{
	  //BOARD_ID_EVT3
	  gpio_direction_input(CUSTOM_OOB_GPIO_NUM);
	  host_oob_irq = OMAP_GPIO_IRQ(CUSTOM_OOB_GPIO_NUM);
	  printk("dhd_customer_oob_irq_map irg = %d \n",host_oob_irq);
	}
	#endif //if 0
	//&*&*&*JohWan2 mod BCM4329 OOB support
	return (host_oob_irq);
}
void cy_as_hal_omap_hardware_deinit(cy_as_omap_dev_kernel *dev_p)
{
	/*
	 * free omap hw resources
	 */
	if (dev_p->m_vma_addr_base != 0)
		iounmap((void *)dev_p->m_vma_addr_base);

	if (dev_p->m_phy_addr_base != 0)
		release_mem_region((void *)dev_p->m_phy_addr_base, SZ_16K);

	gpmc_cs_free(AST_GPMC_CS);

	if (have_irq)
		free_irq(OMAP_GPIO_IRQ(AST_INT), dev_p);

	cy_as_hal_release_user_pads(user_pad_cfg);
}
示例#6
0
static void __init omap_3430sdp_init(void)
{
	platform_add_devices(sdp3430_devices, ARRAY_SIZE(sdp3430_devices));
	omap_board_config = sdp3430_config;
	omap_board_config_size = ARRAY_SIZE(sdp3430_config);
	if (is_sil_rev_greater_than(OMAP3430_REV_ES1_0))
		ts_gpio = OMAP34XX_TS_GPIO_IRQ_SDPV2;
	else
		ts_gpio = OMAP34XX_TS_GPIO_IRQ_SDPV1;
	sdp3430_spi_board_info[0].irq = OMAP_GPIO_IRQ(ts_gpio);
	spi_register_board_info(sdp3430_spi_board_info,
				ARRAY_SIZE(sdp3430_spi_board_info));
	ads7846_dev_init();
	sdp3430_flash_init();
	omap_serial_init();
	sdp3430_usb_init();
	sdp_mmc_init();
}
示例#7
0
static int tda19989_release(struct inode *inode, struct file *filp)
{
    printk(KERN_DEBUG "tda19989_release\n");

    if (g_dev == NULL) {
        printk(KERN_ERR "Invalid device\n");
        return -ENODEV;
    }

    mutex_lock(&g_dev->mtx);

    g_dev->opened = false;

    g_dev->exiting = true;

    if (g_dev->int_enabled)
        disable_irq(OMAP_GPIO_IRQ(g_dev->int_gpio));
    free_irq(gpio_to_irq(g_dev->int_gpio), (void *)NULL);
    gpio_direction_input(g_dev->int_gpio);
    gpio_free(g_dev->int_gpio);

    if (g_dev->waiter)
        wake_up_interruptible(&g_dev->int_wait);

    gpio_direction_input(g_dev->pwr_en_gpio);
    gpio_free(g_dev->pwr_en_gpio);

    if (g_dev->cec_in_use) {
        if (g_dev->cec_reg)
            regulator_disable(g_dev->cec_reg);
        g_dev->cec_in_use = false;
    }
    if (g_dev->cec_reg) {
        regulator_put(g_dev->cec_reg);
        g_dev->cec_reg = NULL;
    }

    mutex_unlock(&g_dev->mtx);

    return 0;
}
示例#8
0
/*
 * All of the FPGA interrupt request inputs except for the touchscreen are
 * edge-sensitive; the touchscreen is level-sensitive.  The edge-sensitive
 * interrupts are acknowledged as a side-effect of reading the interrupt
 * status register from the FPGA.  The edge-sensitive interrupt inputs
 * cause a problem with level interrupt requests, such as Ethernet.  The
 * problem occurs when a level interrupt request is asserted while its
 * interrupt input is masked in the FPGA, which results in a missed
 * interrupt.
 *
 * In an attempt to workaround the problem with missed interrupts, the
 * mask_ack routine for all of the FPGA interrupts has been changed from
 * fpga_mask_ack_irq() to fpga_ack_irq() so that the specific FPGA interrupt
 * being serviced is left unmasked.  We can do this because the FPGA cascade
 * interrupt is installed with the IRQF_DISABLED flag, which leaves all
 * interrupts masked at the CPU while an FPGA interrupt handler executes.
 *
 * Limited testing indicates that this workaround appears to be effective
 * for the smc9194 Ethernet driver used on the Innovator.  It should work
 * on other FPGA interrupts as well, but any drivers that explicitly mask
 * interrupts at the interrupt controller via disable_irq/enable_irq
 * could pose a problem.
 */
void omap1510_fpga_init_irq(void)
{
	int i;

	__raw_writeb(0, OMAP1510_FPGA_IMR_LO);
	__raw_writeb(0, OMAP1510_FPGA_IMR_HI);
	__raw_writeb(0, INNOVATOR_FPGA_IMR2);

	for (i = OMAP1510_IH_FPGA_BASE; i < (OMAP1510_IH_FPGA_BASE + NR_FPGA_IRQS); i++) {

		if (i == OMAP1510_INT_FPGA_TS) {
			/*
			 * The touchscreen interrupt is level-sensitive, so
			 * we'll use the regular mask_ack routine for it.
			 */
			set_irq_chip(i, &omap_fpga_irq_ack);
		}
		else {
			/*
			 * All FPGA interrupts except the touchscreen are
			 * edge-sensitive, so we won't mask them.
			 */
			set_irq_chip(i, &omap_fpga_irq);
		}

		set_irq_handler(i, handle_edge_irq);
		set_irq_flags(i, IRQF_VALID);
	}

	/*
	 * The FPGA interrupt line is connected to GPIO13. Claim this pin for
	 * the ARM.
	 *
	 * NOTE: For general GPIO/MPUIO access and interrupts, please see
	 * gpio.[ch]
	 */
	omap_request_gpio(13);
	omap_set_gpio_direction(13, 1);
	set_irq_type(OMAP_GPIO_IRQ(13), IRQT_RISING);
	set_irq_chained_handler(OMAP1510_INT_FPGA, innovator_fpga_IRQ_demux);
}
示例#9
0
static void omap4_sdp4430_bt_init(void)
{
        int ret = 0;

	omap4_sdp4430_bt_mux_init();

	/* BT + GPS related GPIOs */
	if (gpio_request(GPIO_BTGPS_RST_N, "bcm2076") ||
	    gpio_direction_output(GPIO_BTGPS_RST_N, 1))
		pr_err("Error in initializing Bluetooth chip reset gpio: Unable to set direction. \n");

	gpio_set_value(GPIO_BTGPS_RST_N, 1);

	if (gpio_request(GPIO_BTGPS_EN, "bcm2076") ||
	    gpio_direction_output(GPIO_BTGPS_EN, 1))
		pr_err("Error in initializing Bluetooth power gpio: Unable to set direction.\n");

	gpio_set_value(GPIO_BTGPS_EN, 1);

	// Disable Internal Pull up after the required 100msec delay after BTGPS_EN is asserted
	msleep(120);
	omap_mux_init_gpio(GPIO_BT_HOST_WAKE,
			OMAP_PIN_INPUT | OMAP_PIN_OFF_WAKEUPENABLE | OMAP_WAKEUP_EVENT);

	if (gpio_request(GPIO_BT_WAKE, "bcm2076") ||
	    gpio_direction_output(GPIO_BT_WAKE, 1))
		pr_err("Error in initializing Bluetooth reset gpio: unable to set direction.\n");

	gpio_set_value(GPIO_BT_WAKE, 1);

	ret = platform_device_register(&bcm2076_bluetooth_device);
	if (ret)
	{
		pr_err("could not register bcm2076_bluetooth_device!\n");
	}

	/* BT Host Wake */
	bowser_bluetooth_irq_num = OMAP_GPIO_IRQ(GPIO_BT_HOST_WAKE);
	printk("Configured GPIO_%d as bluetooth host wake interrupt, IRQ num = %d\n", GPIO_BT_HOST_WAKE, bowser_bluetooth_irq_num);
}
示例#10
0
文件: ts_hx.c 项目: kzlin129/tt-gpl
static int __init hx_ts_probe(struct omap_ts_t *ts)
{
	unsigned	gpio;

	if (machine_is_omap_h2()) {
		gpio = H2_GPIO_NUM;
		omap_cfg_reg(P20_1610_GPIO4);
	} else if (machine_is_omap_h3()) {
		gpio = H3_GPIO_NUM;
		omap_cfg_reg(W19_1610_GPIO48);
	} else
		return -ENODEV;

	ts->irq = OMAP_GPIO_IRQ(gpio);
	if (omap_request_gpio(gpio) != 0) {
		printk(KERN_ERR "hX_ts_init.c: Could not reserve GPIO!\n");
		return -EINVAL;
	};

	omap_set_gpio_direction(gpio, 1);
	ts->irq_type = IRQF_TRIGGER_FALLING;
	return 0;
}
int microusbic_fast_init(void)
{
	int microusbic_irq = 0;

     	printk(" Microusbic init\n");

	install_usbic_irq_chip_handler();

	INIT_WORK(&work_device_intr,  work_handler_device_intr);

	////////////////////////////////////////////////////////////
	// microusbic irq
	microusbic_irq = OMAP_GPIO_IRQ(OMAP_GPIO_USBSW_NINT);
	set_irq_type(microusbic_irq, 3);          //IRQT_BOTHEDGE

	if(request_irq(microusbic_irq, microusbic_interrupt,
				IRQF_DISABLED | IRQF_SHARED, "USBIC", (void *)&dev_id))
		printk("[microusbic] Error! irq %d in use.\n", microusbic_irq);
	else
		printk("[microusbic] found microusbic at irq %d\n", microusbic_irq);
	enable_irq_wake(microusbic_irq);
	return 0;
}
示例#12
0
static void omap_kp_scan_keypad(struct omap_kp *omap_kp, unsigned char *state)
{
	int col = 0;

	/* read the keypad status */
	if (cpu_is_omap24xx()) {
		int i;
		for (i = 0; i < omap_kp->rows; i++)
			disable_irq(OMAP_GPIO_IRQ(row_gpios[i]));

		/* read the keypad status */
		for (col = 0; col < omap_kp->cols; col++) {
			set_col_gpio_val(omap_kp, ~(1 << col));
			state[col] = ~(get_row_gpio_val(omap_kp)) & 0x3f;
		}
		set_col_gpio_val(omap_kp, 0);

	} else {
		/* disable keyboard interrupt and schedule for handling */
		omap_writew(1, OMAP_MPUIO_BASE + OMAP_MPUIO_KBD_MASKIT);

		/* read the keypad status */
		omap_writew(0xff, OMAP_MPUIO_BASE + OMAP_MPUIO_KBC);
		for (col = 0; col < omap_kp->cols; col++) {
			omap_writew(~(1 << col) & 0xff,
				    OMAP_MPUIO_BASE + OMAP_MPUIO_KBC);

			udelay(omap_kp->delay);

			state[col] = ~omap_readw(OMAP_MPUIO_BASE +
						 OMAP_MPUIO_KBR_LATCH) & 0xff;
		}
		omap_writew(0x00, OMAP_MPUIO_BASE + OMAP_MPUIO_KBC);
		udelay(2);
	}
}
static int __init smsc43340_usb_probe(struct platform_device *pdev)
{
	struct smsc43340_usb_data *pdata = pdev->dev.platform_data;
	struct smsc43340_usb	  *smsc;
	int			status;

	if (!pdata) {
		dev_dbg(&pdev->dev, "platform_data not available\n");
		return -EINVAL;
	}

	smsc = kzalloc(sizeof *smsc, GFP_KERNEL);
	if (!smsc)
		return -ENOMEM;

	smsc->dev                 = &pdev->dev;
	smsc->otg.dev             = smsc->dev;
	smsc->otg.label           = "smsc43340";
	smsc->otg.set_host        = smsc43340_set_host;
	smsc->otg.set_peripheral  = smsc43340_set_peripheral;
	smsc->otg.set_suspend     = smsc43340_set_suspend;
	smsc->otg.init		  = smsc43340_phy_init;
	smsc->otg.shutdown	  = smsc43340_phy_shutdown;
	smsc->otg.set_clk	  = smsc43340_set_phy_clk;
	smsc->otg.set_vbus	  = smsc43340_set_vbus;
	smsc->asleep              = 1;
	smsc->gpio_reset          = pdata->gpio_reset;
	smsc->gpio_overcurrent    = pdata->gpio_overcurrent;

	if (!gpio_is_valid(smsc->gpio_reset)) {
		kfree(smsc);
		return -EINVAL;
	}

	// Init IRQ
	if (gpio_is_valid(smsc->gpio_overcurrent)) {
		// Get IRQ
		smsc->irq = OMAP_GPIO_IRQ(smsc->gpio_overcurrent);

		if (gpio_request(smsc->gpio_overcurrent, "smsc43340_usb_irq") < 0) {
			printk(KERN_ERR "Failed to request GPIO%d for smsc43340 IRQ\n",
				smsc->gpio_overcurrent);
			return -EIO;
		}
		gpio_direction_input(smsc->gpio_overcurrent);
	}

	smsc43340_phy_init(&smsc->otg);

	otg_set_transceiver(&smsc->otg);

	platform_set_drvdata(pdev, smsc);

        status = request_irq(smsc->irq, smsc43340_usb_irq,
			IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING,
			"smsc43340_usb", smsc);
	if (status < 0) {
		dev_dbg(&pdev->dev, "can't get IRQ %d, err %d\n",
			smsc->irq, status);
		kfree(smsc);
		return status;
	}

        INIT_WORK(&smsc->irq_work, smsc43340_irq_work_handler);

        /* Generate first IRQ */
        smsc43340_usb_irq(smsc->irq, (void *) smsc );

	dev_info(&pdev->dev, "Initialized SMSC 43340 USB module for OMAP 3630 USB OTG\n");
	BLOCKING_INIT_NOTIFIER_HEAD(&smsc->otg.notifier);
	return 0;
}
示例#14
0
	/*SMSC 9220 chipset*/
	case 0x92200000:
	default:
		omap3_evm_version = OMAP3EVM_BOARD_GEN_2;
	}
}

#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
static struct resource omap3evm_smsc911x_resources[] = {
	[0] =	{
		.start	= OMAP3EVM_ETHR_START,
		.end	= (OMAP3EVM_ETHR_START + OMAP3EVM_ETHR_SIZE - 1),
		.flags	= IORESOURCE_MEM,
	},
	[1] =	{
		.start	= OMAP_GPIO_IRQ(OMAP3EVM_ETHR_GPIO_IRQ),
		.end	= OMAP_GPIO_IRQ(OMAP3EVM_ETHR_GPIO_IRQ),
		.flags	= (IORESOURCE_IRQ | IRQF_TRIGGER_LOW),
	},
};

static struct smsc911x_platform_config smsc911x_config = {
	.phy_interface  = PHY_INTERFACE_MODE_MII,
	.irq_polarity   = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
	.irq_type       = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
	.flags          = (SMSC911X_USE_32BIT | SMSC911X_SAVE_MAC_ADDRESS),
};

static struct platform_device omap3evm_smsc911x_device = {
	.name		= "smsc911x",
	.id		= -1,
示例#15
0
}
#else
#define palmte_get_power_status	NULL
#endif

static struct omap_board_config_kernel palmte_config[] __initdata = {
	{ OMAP_TAG_LCD,		&palmte_lcd_config },
	{ OMAP_TAG_UART,	&palmte_uart_config },
};

static struct spi_board_info palmte_spi_info[] __initdata = {
	{
		.modalias	= "tsc2102",
		.bus_num	= 2,	/* uWire (officially) */
		.chip_select	= 0,	/* As opposed to 3 */
		.irq		= OMAP_GPIO_IRQ(PALMTE_PINTDAV_GPIO),
		.max_speed_hz	= 8000000,
	},
};

static void palmte_headphones_detect(void *data, int state)
{
	if (state) {
		/* Headphones connected, disable speaker */
		gpio_set_value(PALMTE_SPEAKER_GPIO, 0);
		printk(KERN_INFO "PM: speaker off\n");
	} else {
		/* Headphones unplugged, re-enable speaker */
		gpio_set_value(PALMTE_SPEAKER_GPIO, 1);
		printk(KERN_INFO "PM: speaker on\n");
	}
}
#ifndef CONFIG_WIFI_CONTROL_FUNC
EXPORT_SYMBOL(sdp4430_wifi_reset);
#endif

struct wifi_platform_data sdp4430_wifi_control = {
	.set_power	= sdp4430_wifi_power,
	.set_reset	= sdp4430_wifi_reset,
	.set_carddetect	= sdp4430_wifi_set_carddetect,
};

#ifdef CONFIG_WIFI_CONTROL_FUNC
static struct resource sdp4430_wifi_resources[] = {
	[0] = {
		.name		= "device_wifi_irq",
		.start		= OMAP_GPIO_IRQ(SDP4430_WIFI_IRQ_GPIO),
		.end		= OMAP_GPIO_IRQ(SDP4430_WIFI_IRQ_GPIO),
		.flags          = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE,
	},
};

static struct platform_device sdp4430_wifi_device = {
	.name           = "device_wifi",
	.id             = 1,
	.num_resources  = ARRAY_SIZE(sdp4430_wifi_resources),
	.resource       = sdp4430_wifi_resources,
	.dev            = {
		.platform_data = &sdp4430_wifi_control,
	},
};
#endif
}

static struct synaptics_i2c_rmi_platform_data synaptics_platform_data[] = {
	{
		.version        = 0x0,
		.power          = &synaptics_power,
		.flags          = SYNAPTICS_SWAP_XY,
		.irqflags       = IRQF_TRIGGER_LOW,
	}
};

static struct i2c_board_info __initdata zoom2_i2c_bus2_info[] = {
	{
		I2C_BOARD_INFO(SYNAPTICS_I2C_RMI_NAME,  0x20),
		.platform_data = &synaptics_platform_data,
		.irq = OMAP_GPIO_IRQ(OMAP_SYNAPTICS_GPIO),
	},
#if (defined(CONFIG_VIDEO_IMX046) || defined(CONFIG_VIDEO_IMX046_MODULE)) && \
	defined(CONFIG_VIDEO_OMAP3)
	{
		I2C_BOARD_INFO(IMX046_NAME, IMX046_I2C_ADDR),
		.platform_data = &zoom2_imx046_platform_data,
	},
#endif
#if (defined(CONFIG_VIDEO_LV8093) || defined(CONFIG_VIDEO_LV8093_MODULE)) && \
	defined(CONFIG_VIDEO_OMAP3)
	{
		I2C_BOARD_INFO(LV8093_NAME,  LV8093_AF_I2C_ADDR),
		.platform_data = &zoom2_lv8093_platform_data,
	},
#endif
示例#18
0
		.platform_data = &twl6040_vddhf,
	},
};

/* i2c_2_info */
static struct i2c_board_info i2c_2_info[] __initdata = {
#if defined(CONFIG_TOUCHSCREEN_P940_GENERAL)
	{
		I2C_BOARD_INFO(LGE_TOUCH_NAME, LGE_TOUCH_ADDR),
		.platform_data = &u2_ts_data,
	},
#endif
#if defined(CONFIG_TOUCHSCREEN_COMMON_SYNAPTICS)
	{
		I2C_BOARD_INFO(LGE_TOUCH_NAME, 0x20),
		.irq = OMAP_GPIO_IRQ(52),
		.platform_data = &synaptics_pdata,
	},
#endif
#if defined(CONFIG_MACH_LGE_U2_P769)
	{
		I2C_BOARD_INFO(LM3530_I2C_NAME, LM3530_I2C_ADDR),
		.platform_data = &lm3530_pdata,
	},
#else
	{
		I2C_BOARD_INFO(LM3533_I2C_NAME, LM3533_I2C_ADDR),
		.platform_data = &lm3533_pdata,
	},
#endif
#if defined(CONFIG_LG_FW_MAX17048_FUEL_GAUGE_I2C)
示例#19
0
	.id		= 0,
	.dev		= {
		.platform_data	= &osk_flash_data,
	},
	.num_resources	= 1,
	.resource	= &osk_flash_resource,
};

static struct resource osk5912_smc91x_resources[] = {
	[0] = {
		.start	= OMAP_OSK_ETHR_START,		/* Physical */
		.end	= OMAP_OSK_ETHR_START + 0xf,
		.flags	= IORESOURCE_MEM,
	},
	[1] = {
		.start	= OMAP_GPIO_IRQ(0),
		.end	= OMAP_GPIO_IRQ(0),
		.flags	= IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
	},
};

static struct platform_device osk5912_smc91x_device = {
	.name		= "smc91x",
	.id		= -1,
	.num_resources	= ARRAY_SIZE(osk5912_smc91x_resources),
	.resource	= osk5912_smc91x_resources,
};

static struct resource osk5912_cf_resources[] = {
	[0] = {
		.start	= OMAP_GPIO_IRQ(62),
示例#20
0
	.startup_delay		= 70000, /* 70ms */
	.enable_high		= 1,
	.enabled_at_boot	= 0,
	.init_data		= &omap3evm_vmmc2,
};

static struct platform_device omap3evm_wlan_regulator = {
	.name		= "reg-fixed-voltage",
	.id		= 1,
	.dev = {
		.platform_data	= &omap3evm_vwlan,
	},
};

struct wl12xx_platform_data omap3evm_wlan_data __initdata = {
	.irq = OMAP_GPIO_IRQ(OMAP3EVM_WLAN_IRQ_GPIO),
	.board_ref_clock = WL12XX_REFCLOCK_38, /* 38.4 MHz */
};
#endif

static struct twl4030_platform_data omap3evm_twldata = {
	.irq_base	= TWL4030_IRQ_BASE,
	.irq_end	= TWL4030_IRQ_END,

	/* platform_data for children goes here */
	.keypad		= &omap3evm_kp_data,
	.madc		= &omap3evm_madc_data,
	.usb		= &omap3evm_usb_data,
	.gpio		= &omap3evm_gpio_data,
	.codec		= &omap3evm_codec_data,
	.vdac		= &omap3_evm_vdac,
}

static const struct ads7846_platform_data palmtt_ts_info = {
	.model			= 7846,
	.vref_delay_usecs	= 100,	/* internal, no capacitor */
	.x_plate_ohms		= 419,
	.y_plate_ohms		= 486,
	.get_pendown_state	= palmtt_get_pendown_state,
};

static struct spi_board_info __initdata palmtt_boardinfo[] = {
	{
		/* MicroWire (bus 2) CS0 has an ads7846e */
		.modalias	= "ads7846",
		.platform_data	= &palmtt_ts_info,
		.irq		= OMAP_GPIO_IRQ(6),
		.max_speed_hz	= 120000	/* max sample rate at 3V */
					* 26	/* command + data + overhead */,
		.bus_num	= 2,
		.chip_select	= 0,
	}
};

static void __init omap_palmtt_init_irq(void)
{
	omap1_init_common_hw();
	omap_init_irq();
}

static struct omap_usb_config palmtt_usb_config __initdata = {
	.register_dev	= 1,
void microusbic_fast_exit(void)
{
	printk(" Microusbic exit\n");
	free_irq(OMAP_GPIO_IRQ(OMAP_GPIO_USBSW_NINT), (void *)dev_id);
}
示例#23
0
               goto err_request_gpio;
        }

        ret = gpio_direction_input(HALL_EFFECT);
        if (ret) {
                printk(KERN_ERR"set BU52061_irq gpio's direction failed, return: %d\n", ret);
				goto err_request_gpio;
        }
		return ret;
err_request_gpio:
        gpio_free(HALL_EFFECT);
        return ret;
}
static struct _bu52061_platform_data bu52061_data = {
        .init_irq       = BU52061_init_irq,
        .irq = OMAP_GPIO_IRQ(HALL_EFFECT),
};
static struct platform_device bu52061_platform_device = {
        .name = "bu52061",
        .id       = -1,
        .dev  = {
                .platform_data = &bu52061_data,
        },
};
#endif
static struct platform_device *bowser_devices[] __initdata = {
/*SW5, Anvoi, 20111215, Config key VolumeUp/VolumeDown{*/
	&bowser_gpio_keys_device,
/*SW5, Anvoi, 20111215, Config key VolumeUp/VolumeDown{*/
#if defined (CONFIG_TATE_HALL_SENSORS)
	&hall_device,
示例#24
0
static void __init osk_mistral_init(void)
{
	/* NOTE:  we could actually tell if there's a Mistral board
	 * attached, e.g. by trying to read something from the ads7846.
	 * But this arch_init() code is too early for that, since we
	 * can't talk to the ads or even the i2c eeprom.
	 */

	/* parallel camera interface */
	omap_cfg_reg(J15_1610_CAM_LCLK);
	omap_cfg_reg(J18_1610_CAM_D7);
	omap_cfg_reg(J19_1610_CAM_D6);
	omap_cfg_reg(J14_1610_CAM_D5);
	omap_cfg_reg(K18_1610_CAM_D4);
	omap_cfg_reg(K19_1610_CAM_D3);
	omap_cfg_reg(K15_1610_CAM_D2);
	omap_cfg_reg(K14_1610_CAM_D1);
	omap_cfg_reg(L19_1610_CAM_D0);
	omap_cfg_reg(L18_1610_CAM_VS);
	omap_cfg_reg(L15_1610_CAM_HS);
	omap_cfg_reg(M19_1610_CAM_RSTZ);
	omap_cfg_reg(Y15_1610_CAM_OUTCLK);

	/* serial camera interface */
	omap_cfg_reg(H19_1610_CAM_EXCLK);
	omap_cfg_reg(W13_1610_CCP_CLKM);
	omap_cfg_reg(Y12_1610_CCP_CLKP);
	/* CCP_DATAM CONFLICTS WITH UART1.TX (and serial console) */
	/* omap_cfg_reg(Y14_1610_CCP_DATAM); */
	omap_cfg_reg(W14_1610_CCP_DATAP);

	/* CAM_PWDN */
	if (omap_request_gpio(11) == 0) {
		omap_cfg_reg(N20_1610_GPIO11);
		omap_set_gpio_direction(11, 0 /* out */);
		omap_set_gpio_dataout(11, 0 /* off */);
	} else
		pr_debug("OSK+Mistral: CAM_PWDN is awol\n");


	/* omap_cfg_reg(P19_1610_GPIO6); */	/* BUSY */
	omap_cfg_reg(P20_1610_GPIO4);	/* PENIRQ */
	set_irq_type(OMAP_GPIO_IRQ(4), IRQT_FALLING);
	spi_register_board_info(mistral_boardinfo,
			ARRAY_SIZE(mistral_boardinfo));

	/* the sideways button (SW1) is for use as a "wakeup" button */
	omap_cfg_reg(N15_1610_MPUIO2);
	if (omap_request_gpio(OMAP_MPUIO(2)) == 0) {
		int ret = 0;
		omap_set_gpio_direction(OMAP_MPUIO(2), 1);
		set_irq_type(OMAP_GPIO_IRQ(OMAP_MPUIO(2)), IRQT_RISING);
#ifdef	CONFIG_PM
		/* share the IRQ in case someone wants to use the
		 * button for more than wakeup from system sleep.
		 */
		ret = request_irq(OMAP_GPIO_IRQ(OMAP_MPUIO(2)),
				&osk_mistral_wake_interrupt,
				IRQF_SHARED, "mistral_wakeup",
				&osk_mistral_wake_interrupt);
		if (ret != 0) {
			omap_free_gpio(OMAP_MPUIO(2));
			printk(KERN_ERR "OSK+Mistral: no wakeup irq, %d?\n",
				ret);
		} else
			enable_irq_wake(OMAP_GPIO_IRQ(OMAP_MPUIO(2)));
#endif
	} else
		printk(KERN_ERR "OSK+Mistral: wakeup button is awol\n");

	/* LCD:  backlight, and power; power controls other devices on the
	 * board, like the touchscreen, EEPROM, and wakeup (!) switch.
	 */
	omap_cfg_reg(PWL);
	if (omap_request_gpio(2) == 0) {
		omap_set_gpio_direction(2, 0 /* out */);
		omap_set_gpio_dataout(2, 1 /* on */);
	}

	platform_add_devices(mistral_devices, ARRAY_SIZE(mistral_devices));
}
示例#25
0
文件: board-h2.c 项目: rhuitl/linux
};

static struct smc91x_platdata h2_smc91x_info = {
	.flags	= SMC91X_USE_16BIT | SMC91X_NOWAIT,
	.leda	= RPC_LED_100_10,
	.ledb	= RPC_LED_TX_RX,
};

static struct resource h2_smc91x_resources[] = {
	[0] = {
		.start	= OMAP1610_ETHR_START,		/* Physical */
		.end	= OMAP1610_ETHR_START + 0xf,
		.flags	= IORESOURCE_MEM,
	},
	[1] = {
		.start	= OMAP_GPIO_IRQ(0),
		.end	= OMAP_GPIO_IRQ(0),
		.flags	= IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE,
	},
};

static struct platform_device h2_smc91x_device = {
	.name		= "smc91x",
	.id		= 0,
	.dev	= {
		.platform_data	= &h2_smc91x_info,
	},
	.num_resources	= ARRAY_SIZE(h2_smc91x_resources),
	.resource	= h2_smc91x_resources,
};
	return 0;
}

static struct max9635_pdata __initdata max9635_platform_data = {
    .gpio           = MAX9635_GPIO_FOR_IRQ,
    .poll_interval  = MAX9635_DEFAULT_POLL_INTERVAL,
	.device_resource = max9635_device_resource,
};
#endif /* CONFIG_MAX9635 */

static struct i2c_board_info __initdata boxer_i2c_bus1_info[] = {
#ifdef CONFIG_BATTERY_MAX17042
	{
		I2C_BOARD_INFO(MAX17042_DEVICE_ID, MAX17042_I2C_SLAVE_ADDRESS),
		.platform_data = &max17042_platform_data_here,
		.irq = OMAP_GPIO_IRQ(MAX17042_GPIO_FOR_IRQ),
	},
#endif	/*CONFIG_BATTERY_MAX17042*/	
	{
		I2C_BOARD_INFO("tps65921", 0x48),
		.flags = I2C_CLIENT_WAKE,
		.irq = INT_34XX_SYS_NIRQ,
		.platform_data = &boxer_twldata,
	},
#ifdef CONFIG_INPUT_KXTF9
	{
		I2C_BOARD_INFO(KXTF9_DEVICE_ID, KXTF9_I2C_SLAVE_ADDRESS),
		.platform_data = &kxtf9_platform_data_here,
		.irq = OMAP_GPIO_IRQ(KXTF9_GPIO_FOR_IRQ),
	},
#endif /* CONFIG_INPUT_KXTF9 */
示例#27
0
				OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP);
	omap_mux_init_signal("sdmmc5_clk.sdmmc5_clk",
				OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP);
	omap_mux_init_signal("sdmmc5_dat0.sdmmc5_dat0",
				OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP);
	omap_mux_init_signal("sdmmc5_dat1.sdmmc5_dat1",
				OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP);
	omap_mux_init_signal("sdmmc5_dat2.sdmmc5_dat2",
				OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP);
	omap_mux_init_signal("sdmmc5_dat3.sdmmc5_dat3",
				OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP);

}

static struct wl12xx_platform_data omap4_sdp4430_wlan_data __initdata = {
	.irq = OMAP_GPIO_IRQ(GPIO_WIFI_IRQ),
	.board_ref_clock = WL12XX_REFCLOCK_26,
	.board_tcxo_clock = WL12XX_TCXOCLOCK_26,
};

static void omap4_sdp4430_wifi_init(void)
{
	omap4_sdp4430_wifi_mux_init();
	if (wl12xx_set_platform_data(&omap4_sdp4430_wlan_data))
		pr_err("Error setting wl12xx data\n");
	platform_device_register(&omap_vwlan_device);
}

static void __init omap_4430sdp_init(void)
{
	int status;
示例#28
0
}
#ifndef CONFIG_WIFI_CONTROL_FUNC
EXPORT_SYMBOL(mapphone_wifi_reset);
#endif

struct wifi_platform_data mapphone_wifi_control = {
        .set_power	= mapphone_wifi_power,
	.set_reset	= mapphone_wifi_reset,
	.set_carddetect	= mapphone_wifi_set_carddetect,
};

#ifdef CONFIG_WIFI_CONTROL_FUNC
static struct resource mapphone_wifi_resources[] = {
	[0] = {
		.name		= "device_wifi_irq",
		.start		= OMAP_GPIO_IRQ(MAPPHONE_WIFI_IRQ_GPIO),
		.end		= OMAP_GPIO_IRQ(MAPPHONE_WIFI_IRQ_GPIO),
		.flags          = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE,
	},
};

static struct platform_device mapphone_wifi_device = {
        .name           = "device_wifi",
        .id             = 1,
        .num_resources  = ARRAY_SIZE(mapphone_wifi_resources),
        .resource       = mapphone_wifi_resources,
        .dev            = {
                .platform_data = &mapphone_wifi_control,
        },
};
#endif
示例#29
0
	/* WLAN PW_EN and IRQ */
	omap_mux_init_gpio(ZOOM3_WIFI_PMENA_GPIO, OMAP_PIN_OUTPUT);
	omap_mux_init_gpio(ZOOM3_WIFI_IRQ_GPIO, OMAP_PIN_INPUT |
				OMAP_PIN_OFF_WAKEUPENABLE);

	/* MMC3 */
	omap_mux_init_signal("etk_clk.sdmmc3_clk", OMAP_PIN_INPUT_PULLUP);
	omap_mux_init_signal("mcspi1_cs1.sdmmc3_cmd", OMAP_PIN_INPUT_PULLUP);
	omap_mux_init_signal("etk_d4.sdmmc3_dat0", OMAP_PIN_INPUT_PULLUP);
	omap_mux_init_signal("etk_d5.sdmmc3_dat1", OMAP_PIN_INPUT_PULLUP);
	omap_mux_init_signal("etk_d6.sdmmc3_dat2", OMAP_PIN_INPUT_PULLUP);
	omap_mux_init_signal("etk_d3.sdmmc3_dat3", OMAP_PIN_INPUT_PULLUP);
}

static struct wl12xx_platform_data zoom3_wlan_data __initdata = {
	.irq = OMAP_GPIO_IRQ(ZOOM3_WIFI_IRQ_GPIO),
	.board_ref_clock = WL12XX_REFCLOCK_26,
	.board_tcxo_clock = WL12XX_TCXOCLOCK_26,
};

static void zoom3_wifi_init(void)
{
	config_wlan_mux();
	if (wl12xx_set_platform_data(&zoom3_wlan_data))
		pr_err("Error setting wl12xx data\n");
}

static void __init omap_zoom_init(void)
{
	if (machine_is_omap_zoom2()) {
		omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
示例#30
0
	&innovator1510_smc91x_device,
	&keypad_device,
};

#endif /* CONFIG_ARCH_OMAP1510 */

#ifdef CONFIG_ARCH_OMAP16XX

static struct resource innovator1610_smc91x_resources[] = {
	[0] = {
		.start	= INNOVATOR1610_ETHR_START,		/* Physical */
		.end	= INNOVATOR1610_ETHR_START + 0xf,
		.flags	= IORESOURCE_MEM,
	},
	[1] = {
		.start	= OMAP_GPIO_IRQ(0),
		.end	= OMAP_GPIO_IRQ(0),
		.flags	= IORESOURCE_IRQ,
	},
};

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

static struct platform_device *innovator1610_devices[] __initdata = {
	&innovator_flash_device,
	&innovator1610_smc91x_device,