Exemplo n.º 1
0
/*
 * Probe for the card. If present the GPIO data would be set.
 */
unsigned int sdhc_get_card_det_status(struct device *dev)
{
	if (to_platform_device(dev)->id == 0) {
		return mxc_get_gpio_datain(MX31_PIN_STX0);
	} else
		return mxc_get_gpio_datain(MX31_PIN_DSR_DCE1);
}
/*!
 * Get WP pin value to detect write protection
 */
int sdhc_write_protect(struct device *dev)
{
	unsigned short rc = 0;

	if (to_platform_device(dev)->id == 0)
		rc = mxc_get_gpio_datain(MX51_PIN_GPIO1_1);
	else
		rc = 0;
	return rc;
}
/*
 * Probe for the card. If present the GPIO data would be set.
 */
unsigned int sdhc_get_card_det_status(struct device *dev)
{
	int ret;

	if (to_platform_device(dev)->id == 0) {
		ret = mxc_get_gpio_datain(MX51_PIN_GPIO1_0);
		return ret;
	} else {		/* config the det pin for SDHC2 */
		return 0;
	}
}
/*!
 * Get CSPI1_SS0 pin value to detect write protection
 */
int sdhc_write_protect(struct device *dev)
{
#if 0
	unsigned short rc = 0;

	rc = mxc_get_gpio_datain(MX37_PIN_CSPI1_SS0);
	if (rc > 0)
		return 1;
	else
#endif
		return 0;
}
int gpio_gps_access(int para)
{
	iomux_pin_name_t pin;
	pin = (para & 0x1) ? MX51_PIN_EIM_CS2 : MX51_PIN_EIM_CRE;

	if (para & 0x4) /* Read GPIO */
		return mxc_get_gpio_datain(pin);
	else if (para & 0x2) /* Write GPIO */
		mxc_set_gpio_dataout(pin, 1);
	else
		mxc_set_gpio_dataout(pin, 0);
	return 0;
}
/*
 * Probe for the card. If present the GPIO data would be set.
 */
int sdhc_get_card_det_status(struct device *dev)
{
#if defined(GPIO_SDHC_ENABLE)
	int ret;

	if (to_platform_device(dev)->id == 0) {
		ret = mxc_get_gpio_datain(MX37_PIN_UART1_CTS);
		return ret;
	} else {		/* config the det pin for SDHC2 */
		return 0;
	}
#endif
}
Exemplo n.º 7
0
/*!
 * Get irq for gpio pins
 * @param  pin                GPIO pin name
 * @param  trigger_flag [out] The initial trigger flag.
 * @return The irq associated with gpio pin.
 */
u32 get_gpio_irq(iomux_pin_name_t pin, unsigned long* trigger_flag)
{
	int val;

	mxc_request_iomux(pin, OUTPUTCONFIG_GPIO, INPUTCONFIG_GPIO);
	if ((pin != MX31_PIN_DTR_DCE1) && (pin != MX31_PIN_KEY_ROW4))
		mxc_iomux_set_pad(pin, PAD_CTL_PKE_NONE);
	mxc_set_gpio_direction(pin, 1);
	val = mxc_get_gpio_datain(pin);

	if (val == 0)
	{
		// Now the gpio pin is in low electrical level, should be trigger by high
		*trigger_flag = IRQF_TRIGGER_RISING;
	}
	else
	{
		// Now the gpio pin is in high electrical level, should be trigger by low
		*trigger_flag = IRQF_TRIGGER_FALLING;
	}
	return IOMUX_TO_IRQ(pin);
}
int headphone_det_status(void)
{
	return mxc_get_gpio_datain(MX51_PIN_EIM_A26);
}
Exemplo n.º 9
0
/*!
 * Get SD1_WP ADIN7 of ATLAS pin value to detect write protection
 */
int sdhc_write_protect(struct device *dev)
{
	return mxc_get_gpio_datain(MX31_PIN_SIMPD0);
}
Exemplo n.º 10
0
static bool bs_hardware_ready(void *unused)
{
    return ( !broadsheet_force_hw_not_ready() && mxc_get_gpio_datain(BROADSHEET_HRDY_LINE) );
}