예제 #1
0
static int headphone_det_status(void)
{
	if (cpu_is_mx51_rev(CHIP_REV_1_1) == 2)
		return (gpio_get_value(IOMUX_TO_GPIO(MX51_PIN_NANDF_D14)) == 0);

	return gpio_get_value(IOMUX_TO_GPIO(MX51_PIN_NANDF_CS0));
}
예제 #2
0
static void __init mxc_board_init(void)
{
	int ret;

	mxc_iomux_setup_multiple_pins(pcm037_pins, ARRAY_SIZE(pcm037_pins),
			"pcm037");

	if (pcm037_variant() == PCM037_EET)
		mxc_iomux_setup_multiple_pins(pcm037_uart1_pins,
			ARRAY_SIZE(pcm037_uart1_pins), "pcm037_uart1");
	else
		mxc_iomux_setup_multiple_pins(pcm037_uart1_handshake_pins,
			ARRAY_SIZE(pcm037_uart1_handshake_pins),
			"pcm037_uart1");

	platform_add_devices(devices, ARRAY_SIZE(devices));

	mxc_register_device(&mxc_uart_device0, &uart_pdata);
	mxc_register_device(&mxc_uart_device1, &uart_pdata);
	mxc_register_device(&mxc_uart_device2, &uart_pdata);

	mxc_register_device(&mxc_w1_master_device, NULL);

	
	ret = gpio_request(IOMUX_TO_GPIO(MX31_PIN_GPIO3_1), "lan9217-irq");
	if (ret)
		pr_warning("could not get LAN irq gpio\n");
	else {
		gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_GPIO3_1));
		platform_device_register(&pcm037_eth);
	}


	
	i2c_register_board_info(1, pcm037_i2c_devices,
			ARRAY_SIZE(pcm037_i2c_devices));

	mxc_register_device(&mxc_i2c_device1, &pcm037_i2c_1_data);
	mxc_register_device(&mxc_i2c_device2, &pcm037_i2c_2_data);

	mxc_register_device(&mxc_nand_device, &pcm037_nand_board_info);
	mxc_register_device(&mxcsdhc_device0, &sdhc_pdata);
	mxc_register_device(&mx3_ipu, &mx3_ipu_data);
	mxc_register_device(&mx3_fb, &mx3fb_pdata);
	if (!gpio_usbotg_hs_activate())
		mxc_register_device(&mxc_otg_udc_device, &usb_pdata);

	
	
	ret = gpio_request(IOMUX_TO_GPIO(MX31_PIN_CSI_D5), "mt9t031-power");
	if (!ret)
		gpio_direction_output(IOMUX_TO_GPIO(MX31_PIN_CSI_D5), 1);
	else
		iclink.power = NULL;

	if (!pcm037_camera_alloc_dma(4 * 1024 * 1024))
		mxc_register_device(&mx3_camera, &camera_pdata);

	platform_device_register(&pcm970_sja1000);
}
예제 #3
0
static int __init kzm_init_ext_uart(void)
{
	u8 tmp;

	/*
	 * GPIO 1-1: external UART interrupt line
	 */
	mxc_iomux_mode(IOMUX_MODE(MX31_PIN_GPIO1_1, IOMUX_CONFIG_GPIO));
	gpio_request(IOMUX_TO_GPIO(MX31_PIN_GPIO1_1), "ext-uart-int");
	gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_GPIO1_1));

	/*
	 * Unmask UART interrupt
	 */
	tmp = __raw_readb(KZM_ARM11_IO_ADDRESS(KZM_ARM11_CTL1));
	tmp |= 0x2;
	__raw_writeb(tmp, KZM_ARM11_IO_ADDRESS(KZM_ARM11_CTL1));

	serial_platform_data[0].irq =
			gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO1_1));
	serial8250_resources[1].start =
			gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO1_1));
	serial8250_resources[1].end =
			gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO1_1));

	return platform_device_register(&serial_device);
}
예제 #4
0
/*
 * Reset USB PHY (or PHYs on EfikaSB)
 */
static void efika_usb_phy_reset(void)
{
	/* SMSC 3317 PHY reset */
	gpio_direction_output(IOMUX_TO_GPIO(MX51_PIN_EIM_D27), 0);
	udelay(1000);
	gpio_set_value(IOMUX_TO_GPIO(MX51_PIN_EIM_D27), 1);
}
예제 #5
0
파일: efikamx.c 프로젝트: Apaisal/u-boot
static void setup_iomux_spi(void)
{
	/* 000: Select mux mode: ALT0 mux port: MOSI of instance: ecspi1 */
	mxc_request_iomux(MX51_PIN_CSPI1_MOSI, IOMUX_CONFIG_ALT0);
	mxc_iomux_set_pad(MX51_PIN_CSPI1_MOSI,
		PAD_CTL_HYS_ENABLE | PAD_CTL_DRV_HIGH | PAD_CTL_SRE_FAST);

	/* 000: Select mux mode: ALT0 mux port: MISO of instance: ecspi1. */
	mxc_request_iomux(MX51_PIN_CSPI1_MISO, IOMUX_CONFIG_ALT0);
	mxc_iomux_set_pad(MX51_PIN_CSPI1_MISO,
		PAD_CTL_HYS_ENABLE | PAD_CTL_DRV_HIGH | PAD_CTL_SRE_FAST);

	/* Configure SS0 as a GPIO */
	mxc_request_iomux(MX51_PIN_CSPI1_SS0, IOMUX_CONFIG_GPIO);
	gpio_direction_output(IOMUX_TO_GPIO(MX51_PIN_CSPI1_SS0), 0);

	/* Configure SS1 as a GPIO */
	mxc_request_iomux(MX51_PIN_CSPI1_SS1, IOMUX_CONFIG_GPIO);
	gpio_direction_output(IOMUX_TO_GPIO(MX51_PIN_CSPI1_SS1), 1);

	/* 000: Select mux mode: ALT0 mux port: SS2 of instance: ecspi1. */
	mxc_request_iomux(MX51_PIN_CSPI1_RDY, IOMUX_CONFIG_ALT0);
	mxc_iomux_set_pad(MX51_PIN_CSPI1_RDY,
		PAD_CTL_HYS_ENABLE | PAD_CTL_PKE_ENABLE);

	/* 000: Select mux mode: ALT0 mux port: SCLK of instance: ecspi1. */
	mxc_request_iomux(MX51_PIN_CSPI1_SCLK, IOMUX_CONFIG_ALT0);
	mxc_iomux_set_pad(MX51_PIN_CSPI1_SCLK,
		PAD_CTL_HYS_ENABLE | PAD_CTL_DRV_HIGH | PAD_CTL_SRE_FAST);
}
/*
 * system init for baseboard usage. Will be called by mx31moboard init.
 */
void __init mx31moboard_marxbot_init(void)
{
	printk(KERN_INFO "Initializing mx31marxbot peripherals\n");

	mxc_iomux_setup_multiple_pins(marxbot_pins, ARRAY_SIZE(marxbot_pins),
		"marxbot");

	marxbot_init_sel_gpios();

	dspics_resets_init();

	mxc_register_device(&mxcsdhc_device1, &sdhc2_pdata);

	spi_register_board_info(marxbot_spi_board_info,
		ARRAY_SIZE(marxbot_spi_board_info));

	marxbot_cam_init();
	platform_add_devices(marxbot_cameras, ARRAY_SIZE(marxbot_cameras));

	/* battery present pin */
	gpio_request(IOMUX_TO_GPIO(MX31_PIN_LCS0), "bat-present");
	gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_LCS0));
	gpio_export(IOMUX_TO_GPIO(MX31_PIN_LCS0), false);

	mxc_register_device(&mxc_otg_udc_device, &usb_pdata);

	marxbot_usbh1_init();
}
예제 #7
0
void mx50_yoshi_gpio_spi_chipselect_active(int cspi_mode, int status,
		                             int chipselect)
{
	switch (cspi_mode) {
	case 1:
		break;
	case 2:
		break;
	case 3:
		switch (chipselect) {
		case 0x1:
		        /* enable ss0 */
		        mxc_request_iomux(MX50_PIN_CSPI_SS0, IOMUX_CONFIG_ALT0);
		        /*disable other ss */
		        mxc_request_iomux(MX50_PIN_ECSPI1_MOSI, IOMUX_CONFIG_GPIO);
		        /* pull up/down deassert it */
		        gpio_direction_input(IOMUX_TO_GPIO(MX50_PIN_ECSPI1_MOSI));
		        break;
		case 0x2:
		        /* enable ss1 */
		        mxc_request_iomux(MX50_PIN_ECSPI1_MOSI, IOMUX_CONFIG_ALT2);
		        /*disable other ss */
		        mxc_request_iomux(MX50_PIN_CSPI_SS0, IOMUX_CONFIG_GPIO);
		        /* pull up/down deassert it */
		        gpio_direction_input(IOMUX_TO_GPIO(MX50_PIN_CSPI_SS0));
		        break;
		default:
		        break;
		}
		break;

	default:
		break;
	}
}
static void __init mx31lite_late(void)
{
	int ret;

	if (mx31lite_baseboard == MX31LITE_DB)
		mx31lite_db_init();

	mc13783_spi_dev.irq = gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO1_3));
	spi_register_board_info(&mc13783_spi_dev, 1);

	/* USB */
	usbh2_pdata.otg = imx_otg_ulpi_create(ULPI_OTG_DRVVBUS |
			ULPI_OTG_DRVVBUS_EXT);
	if (usbh2_pdata.otg)
		imx31_add_mxc_ehci_hs(2, &usbh2_pdata);

	/* SMSC9117 IRQ pin */
	ret = gpio_request(IOMUX_TO_GPIO(MX31_PIN_SFS6), "sms9117-irq");
	if (ret)
		pr_warn("could not get LAN irq gpio\n");
	else {
		gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_SFS6));
		smsc911x_resources[1].start =
			gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_SFS6));
		smsc911x_resources[1].end =
			gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_SFS6));
		platform_device_register(&smsc911x_device);
	}
}
예제 #9
0
/* Called during ship mode */
void gpio_watchdog_low(void)
{
	printk(KERN_CRIT "Halting ...\n");

	/* configure the PMIC for WDIRESET */
	pmic_write_reg(REG_POWER_CTL2, (0 << WDIRESET_LSH), (1 << WDIRESET_LSH));

	/* Turn on RESTARTEN */
	pmic_write_reg(REG_POWER_CTL2, (1 << RESTARTEN_LSH), (1 << RESTARTEN_LSH));

	/* Free WDOG as ALT2 */
	mxc_free_iomux(MX50_PIN_WDOG, IOMUX_CONFIG_ALT2);

	/* Re-request as GPIO */
	mxc_request_iomux(MX50_PIN_WDOG, IOMUX_CONFIG_ALT1);

	/* Pad settings */
	mxc_iomux_set_pad(MX50_PIN_WDOG, PAD_CTL_HYS_NONE | PAD_CTL_PKE_NONE |
				PAD_CTL_DRV_HIGH | PAD_CTL_ODE_OPENDRAIN_NONE);

	/* Enumerate */
	gpio_request(IOMUX_TO_GPIO(MX50_PIN_WDOG), "wdog");

	/* Direction output */
	gpio_direction_output(IOMUX_TO_GPIO(MX50_PIN_WDOG), 0);

	/* Set low */
	gpio_set_value(IOMUX_TO_GPIO(MX50_PIN_WDOG), 0);
}
예제 #10
0
static int mxc_mmc1_init(struct device *dev,
			 irq_handler_t detect_irq, void *data)
{
	int ret;

	gpio_det = IOMUX_TO_GPIO(MX31_PIN_GPIO1_1);
	gpio_wp = IOMUX_TO_GPIO(MX31_PIN_LCS0);

	ret = gpio_request(gpio_det, "MMC detect");
	if (ret)
		return ret;

	ret = gpio_request(gpio_wp, "MMC w/p");
	if (ret)
		goto exit_free_det;

	gpio_direction_input(gpio_det);
	gpio_direction_input(gpio_wp);

	ret = request_irq(IOMUX_TO_IRQ(MX31_PIN_GPIO1_1), detect_irq,
			  IRQF_DISABLED | IRQF_TRIGGER_FALLING,
			  "MMC detect", data);
	if (ret)
		goto exit_free_wp;

	return 0;

exit_free_wp:
	gpio_free(gpio_wp);

exit_free_det:
	gpio_free(gpio_det);

	return ret;
}
예제 #11
0
void si4702_reset(void)
{
	gpio_set_value(IOMUX_TO_GPIO(MX31_PIN_SRST0), 0);
	msleep(100);
	gpio_set_value(IOMUX_TO_GPIO(MX31_PIN_SRST0), 1);
	msleep(100);
}
예제 #12
0
static void qong_nand_select_chip(struct mtd_info *mtd, int chip)
{
	if (chip >= 0)
		gpio_set_value(IOMUX_TO_GPIO(MX31_PIN_NFCE_B), 0);
	else
		gpio_set_value(IOMUX_TO_GPIO(MX31_PIN_NFCE_B), 1);
}
예제 #13
0
static void si4702_reset(void)
{
	gpio_set_value(IOMUX_TO_GPIO(MX51_PIN_EIM_DTACK), 0);
	msleep(100);
	gpio_set_value(IOMUX_TO_GPIO(MX51_PIN_EIM_DTACK), 1);
	msleep(100);
}
예제 #14
0
static void __init moboard_uart0_init(void)
{
	if (!gpio_request(IOMUX_TO_GPIO(MX31_PIN_CTS1), "uart0-cts-hack")) {
		gpio_direction_output(IOMUX_TO_GPIO(MX31_PIN_CTS1), 0);
		gpio_free(IOMUX_TO_GPIO(MX31_PIN_CTS1));
	}
}
예제 #15
0
void mx53_gpio_host1_driver_vbus(bool on)
{
	if (on)
		gpio_set_value(IOMUX_TO_GPIO(MX53_PIN_ATA_DA_2), 1);
	else
		gpio_set_value(IOMUX_TO_GPIO(MX53_PIN_ATA_DA_2), 0);
}
예제 #16
0
void gpio_cs42888_pdwn(int pdwn)
{
	if (pdwn)
		gpio_set_value(IOMUX_TO_GPIO(MX53_PIN_GPIO_12), 0);
	else
		gpio_set_value(IOMUX_TO_GPIO(MX53_PIN_GPIO_12), 1);
}
예제 #17
0
void flexcan_xcvr_enable(int id, int en)
{
	static int pwdn;
	if (id < 0 || id > 1)
		return;

	if (en) {
		if (!(pwdn++))
			gpio_set_value(IOMUX_TO_GPIO(MX53_PIN_GPIO_19), 1);

		if (id == 0) {
			gpio_set_value(IOMUX_TO_GPIO(MX53_PIN_GPIO_18), 1);
			gpio_set_value(IOMUX_TO_GPIO(MX53_PIN_GPIO_17), 1);
		} else {
			gpio_set_value(IOMUX_TO_GPIO(MX53_PIN_CSI0_D6), 1);
			gpio_set_value(IOMUX_TO_GPIO(MX53_PIN_GPIO_14), 1);
		}

	} else {
		if (!(--pwdn))
			gpio_set_value(IOMUX_TO_GPIO(MX53_PIN_GPIO_19), 0);

		if (id == 0) {
			gpio_set_value(IOMUX_TO_GPIO(MX53_PIN_GPIO_18), 0);
			gpio_set_value(IOMUX_TO_GPIO(MX53_PIN_GPIO_17), 0);
		} else {
			gpio_set_value(IOMUX_TO_GPIO(MX53_PIN_CSI0_D6), 0);
			gpio_set_value(IOMUX_TO_GPIO(MX53_PIN_GPIO_14), 0);
		}
	}
}
예제 #18
0
static void si4702_reset(void)
{
	return;
	gpio_set_value(IOMUX_TO_GPIO(MX51_PIN_EIM_A21), 0);
	msleep(100);
	gpio_set_value(IOMUX_TO_GPIO(MX51_PIN_EIM_A21), 1);
	msleep(100);
}
예제 #19
0
void gpio_wan_power(int enable)
{
	/* Set the direction to output */
	gpio_direction_output(IOMUX_TO_GPIO(MX50_PIN_EIM_RW), 0);

	/* Enable/disable power */
	gpio_set_value(IOMUX_TO_GPIO(MX50_PIN_EIM_RW), enable);
}
예제 #20
0
void gpio_chrgled_active(int enable)
{
	if (charger_led_state != enable) {
		gpio_direction_output(IOMUX_TO_GPIO(MX50_PIN_EIM_DA2), 0);
		gpio_set_value(IOMUX_TO_GPIO(MX50_PIN_EIM_DA2), !enable);

		charger_led_state = enable;
	}
}
예제 #21
0
/*
 * Reset USB HUB (or HUBs on EfikaSB)
 */
static void efika_usb_hub_reset(void)
{
	/* HUB reset */
	gpio_direction_output(IOMUX_TO_GPIO(MX51_PIN_GPIO1_5), 1);
	udelay(1000);
	gpio_set_value(IOMUX_TO_GPIO(MX51_PIN_GPIO1_5), 0);
	udelay(1000);
	gpio_set_value(IOMUX_TO_GPIO(MX51_PIN_GPIO1_5), 1);
}
예제 #22
0
int mx51_efikamx_reboot(void)
{
	if ( machine_is_mx51_efikamx() && (mx51_efikamx_revision() == 1) ) /* board rev1.1 */
		gpio_direction_output(IOMUX_TO_GPIO(EFIKAMX_WATCHDOG_REBOOT), 0);
	else
		gpio_direction_output(IOMUX_TO_GPIO(EFIKASB_WATCHDOG_REBOOT), 0);

	return 0;
}
예제 #23
0
static void lcd_reset(void)
{
	gpio_set_value(IOMUX_TO_GPIO(MX51_PIN_DISPB2_SER_RS), 0);
	gpio_request(IOMUX_TO_GPIO(MX51_PIN_DISPB2_SER_RS), "ser_rs");
	gpio_direction_output(IOMUX_TO_GPIO(MX51_PIN_DISPB2_SER_RS), 0);
	/* do reset */
	msleep(10);		/* tRES >= 100us */
	gpio_set_value(IOMUX_TO_GPIO(MX51_PIN_DISPB2_SER_RS), 1);
	msleep(60);
}
예제 #24
0
int __init mx51_efikamx_init_pmic(void)
{
	CONFIG_IOMUX(mx51_efikamx_pmic_iomux_pins);

	/* disable power gating for some reason */
	if (machine_is_mx51_efikasb())
		pmic_write_reg(REG_POWER_MISC, ~(PWGT1SPIEN|PWGT2SPIEN), (PWGT1SPIEN|PWGT2SPIEN));

	if (machine_is_mx51_efikamx() && (mx51_efikamx_revision() == 1)) {
		CONFIG_IOMUX(mx51_efikamx_watchdog_pins);

		gpio_free(IOMUX_TO_GPIO(EFIKAMX_WATCHDOG_REBOOT));
		gpio_request(IOMUX_TO_GPIO(EFIKAMX_WATCHDOG_REBOOT), "sys:reboot");
		gpio_direction_output(IOMUX_TO_GPIO(EFIKAMX_WATCHDOG_REBOOT), 1);
	} else {
		CONFIG_IOMUX(mx51_efikasb_watchdog_pins);

		gpio_free(IOMUX_TO_GPIO(EFIKASB_WATCHDOG_REBOOT));
		gpio_request(IOMUX_TO_GPIO(EFIKASB_WATCHDOG_REBOOT), "sys:reboot");
		gpio_direction_output(IOMUX_TO_GPIO(EFIKASB_WATCHDOG_REBOOT), 1);

		if (machine_is_mx51_efikasb()) {
			CONFIG_IOMUX(mx51_efikasb_power_pins);

			gpio_free(IOMUX_TO_GPIO(EFIKASB_POWERGOOD));
			gpio_request(IOMUX_TO_GPIO(EFIKASB_POWERGOOD), "sys:powergood");
			gpio_direction_input(IOMUX_TO_GPIO(EFIKASB_POWERGOOD));
		}
	}

	return spi_register_board_info(mc13892_spi_device, ARRAY_SIZE(mc13892_spi_device));
}
예제 #25
0
static void vga_reset(void)
{
	gpio_request(IOMUX_TO_GPIO(MX51_PIN_EIM_A19), "eim_a19");
	gpio_direction_output(IOMUX_TO_GPIO(MX51_PIN_EIM_A19), 0);
	gpio_set_value(IOMUX_TO_GPIO(MX51_PIN_EIM_A19), 0);
	msleep(50);
	/* do reset */
	gpio_set_value(IOMUX_TO_GPIO(MX51_PIN_EIM_A19), 1);
	msleep(10);		/* tRES >= 50us */
	gpio_set_value(IOMUX_TO_GPIO(MX51_PIN_EIM_A19), 0);
}
static int __init kzm_init_smsc9118(void)
{
	/*
	 * GPIO 1-2: SMSC9118 interrupt line
	 */
	mxc_iomux_mode(IOMUX_MODE(MX31_PIN_GPIO1_2, IOMUX_CONFIG_GPIO));
	gpio_request(IOMUX_TO_GPIO(MX31_PIN_GPIO1_2), "smsc9118-int");
	gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_GPIO1_2));

	return platform_device_register(&kzm_smsc9118_device);
}
예제 #27
0
파일: usb_h1.c 프로젝트: pocketbook/801
static void gpio_usbh1_inactive(void)
{
	/* Signal only used on MX51-3DS for reset to PHY.*/
	if (machine_is_mx51_3ds()) {
		gpio_free(IOMUX_TO_GPIO(MX51_PIN_EIM_D17));
		mxc_free_iomux(MX51_PIN_EIM_D17, IOMUX_CONFIG_GPIO);
	}

	mxc_free_iomux(MX51_PIN_USBH1_STP, IOMUX_CONFIG_GPIO);
	gpio_free(IOMUX_TO_GPIO(MX51_PIN_USBH1_STP));
}
예제 #28
0
static int sdhc_write_protect(struct device *dev)
{
	unsigned short rc = 0;

	if (to_platform_device(dev)->id == 0)
		rc = gpio_get_value(IOMUX_TO_GPIO(MX51_PIN_GPIO1_1));
	else
		rc = gpio_get_value(IOMUX_TO_GPIO(MX51_PIN_GPIO1_5));

	return rc;
}
예제 #29
0
static void si4702_gpio_get(void)
{
	/* reset pin */
	mxc_request_iomux(MX31_PIN_SRST0, OUTPUTCONFIG_GPIO, INPUTCONFIG_NONE);
	gpio_request(IOMUX_TO_GPIO(MX31_PIN_SRST0), "srst0");
	gpio_direction_output(IOMUX_TO_GPIO(MX31_PIN_SRST0), 0);

	mxc_request_iomux(MX31_PIN_SIMPD0, OUTPUTCONFIG_GPIO, INPUTCONFIG_NONE);
	gpio_request(IOMUX_TO_GPIO(MX31_PIN_SIMPD0), "simpd0");
	gpio_direction_output(IOMUX_TO_GPIO(MX31_PIN_SIMPD0), 0);
}
예제 #30
0
static int mxc_init_ch7024(void)
{
	/* request gpio for phone jack detect */
	mxc_request_iomux(MX31_PIN_BATT_LINE, OUTPUTCONFIG_GPIO,
			  INPUTCONFIG_GPIO);
	mxc_iomux_set_pad(MX31_PIN_BATT_LINE, PAD_CTL_PKE_NONE);
	gpio_request(IOMUX_TO_GPIO(MX31_PIN_BATT_LINE), "batt_line");
	gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_BATT_LINE));

	return 0;
}