static int sgtl5000_headphone_det_status(void) { int ret = 0; if (0 != pmic_gpio_get_designation_bit_val(0, &ret)) printk(KERN_ERR "Get headphone status error."); return ret; }
/*! * Get pin value to detect write protection */ int sdhc_write_protect(struct device *dev) { unsigned int rc = 0; if (0 != pmic_gpio_get_designation_bit_val(3, &rc)) printk(KERN_ERR "Get wp status error."); return rc; }
/* * Probe for the card. If present the GPIO data would be set. */ unsigned int sdhc_get_card_det_status(struct device *dev) { unsigned int ret; if (to_platform_device(dev)->id == 0) { if (0 != pmic_gpio_get_designation_bit_val(2, &ret)) printk(KERN_ERR "Get cd status error."); return ret; } else { /* config the det pin for SDHC2 */ return 0; } }
static ssize_t show_headphone(struct device_driver *dev, char *buf) { unsigned int value; pmic_gpio_get_designation_bit_val(0, &value); if (value == 0) strcpy(buf, "speaker\n"); else strcpy(buf, "headphone\n"); return strlen(buf); }
static unsigned int sdhc_get_card_det_status(struct device *dev) { unsigned int ret; if (board_is_rev(BOARD_REV_2)) pmic_gpio_set_bit_val(MCU_GPIO_REG_GPIO_CONTROL_2, 7, 1); if (to_platform_device(dev)->id == 0) { if (0 != pmic_gpio_get_designation_bit_val(2, &ret)) printk(KERN_ERR "Get cd status error."); return ret; } return 0; }