Loading drivers/gpio/gpiolib.c +15 −1 Original line number Diff line number Diff line Loading @@ -63,13 +63,17 @@ static inline void desc_set_label(struct gpio_desc *d, const char *label) /** * Convert a GPIO number to its descriptor */ #ifdef CONFIG_MACH_XIAOMI_MIDO static int special_irq; #endif struct gpio_desc *gpio_to_desc(unsigned gpio) { #ifdef CONFIG_MACH_XIAOMI_MIDO if (gpio == 65) special_irq = 1; else special_irq = 0; #endif if (WARN(!gpio_is_valid(gpio), "invalid GPIO %d\n", gpio)) return NULL; else Loading Loading @@ -988,7 +992,9 @@ int gpiod_direction_input(struct gpio_desc *desc) return status; } EXPORT_SYMBOL_GPL(gpiod_direction_input); #ifdef CONFIG_MACH_XIAOMI_MIDO extern int gt9xx_flag; #endif static int _gpiod_direction_output_raw(struct gpio_desc *desc, int value) { Loading @@ -996,6 +1002,7 @@ static int _gpiod_direction_output_raw(struct gpio_desc *desc, int value) int status = -EINVAL; /* GPIOs used for IRQs shall not be set as output */ #ifdef CONFIG_MACH_XIAOMI_MIDO if ((special_irq == 1) && (gt9xx_flag == 1)) { printk("[GPIO]set GPIO_65 as irq output\n"); } else{ Loading @@ -1006,7 +1013,14 @@ static int _gpiod_direction_output_raw(struct gpio_desc *desc, int value) return -EIO; } } #else if (test_bit(FLAG_USED_AS_IRQ, &desc->flags)) { gpiod_err(desc, "%s: tried to set a GPIO tied to an IRQ as output\n", __func__); return -EIO; } #endif /* Open drain pin should not be driven to 1 */ if (value && test_bit(FLAG_OPEN_DRAIN, &desc->flags)) return gpiod_direction_input(desc); Loading sound/soc/msm/msm8952.c +8 −2 Original line number Diff line number Diff line Loading @@ -96,6 +96,7 @@ static struct wcd_mbhc_config mbhc_cfg = { .mono_stero_detection = false, .swap_gnd_mic = NULL, .hs_ext_micbias = false, #ifdef CONFIG_MACH_XIAOMI_MSM8953 #ifdef CONFIG_MACH_XIAOMI_MIDO .key_code[0] = KEY_MEDIA, .key_code[1] = BTN_1, Loading @@ -105,7 +106,8 @@ static struct wcd_mbhc_config mbhc_cfg = { .key_code[5] = 0, .key_code[6] = 0, .key_code[7] = 0, #else ifdef CONFIG_MACH_XIAOMI_MARKW #endif #ifdef CONFIG_MACH_XIAOMI_MARKW .key_code[0] = KEY_MEDIA, .key_code[1] = KEY_PREVIOUSSONG_NEW, .key_code[2] = KEY_NEXTSONG_NEW, Loading @@ -114,6 +116,7 @@ static struct wcd_mbhc_config mbhc_cfg = { .key_code[5] = 0, .key_code[6] = 0, .key_code[7] = 0, #endif #else .key_code[0] = KEY_MEDIA, .key_code[1] = KEY_VOICECOMMAND, Loading Loading @@ -1615,6 +1618,7 @@ static void *def_msm8952_wcd_mbhc_cal(void) * 210-290 == Button 2 * 360-680 == Button 3 */ #ifdef CONFIG_MACH_XIAOMI_MSM8953 #ifdef CONFIG_MACH_XIAOMI_MIDO btn_low[0] = 73; btn_high[0] = 73; Loading @@ -1626,7 +1630,8 @@ static void *def_msm8952_wcd_mbhc_cal(void) btn_high[3] = 438; btn_low[4] = 438; btn_high[4] = 438; #else ifdef CONFIG_MACH_XIAOMI_MARKW #endif #ifdef CONFIG_MACH_XIAOMI_MARKW btn_low[0] = 25; btn_high[0] = 75; btn_low[1] = 200; Loading @@ -1637,6 +1642,7 @@ static void *def_msm8952_wcd_mbhc_cal(void) btn_high[3] = 510; btn_low[4] = 530; btn_high[4] = 540; #endif #else btn_low[0] = 75; btn_high[0] = 75; Loading Loading
drivers/gpio/gpiolib.c +15 −1 Original line number Diff line number Diff line Loading @@ -63,13 +63,17 @@ static inline void desc_set_label(struct gpio_desc *d, const char *label) /** * Convert a GPIO number to its descriptor */ #ifdef CONFIG_MACH_XIAOMI_MIDO static int special_irq; #endif struct gpio_desc *gpio_to_desc(unsigned gpio) { #ifdef CONFIG_MACH_XIAOMI_MIDO if (gpio == 65) special_irq = 1; else special_irq = 0; #endif if (WARN(!gpio_is_valid(gpio), "invalid GPIO %d\n", gpio)) return NULL; else Loading Loading @@ -988,7 +992,9 @@ int gpiod_direction_input(struct gpio_desc *desc) return status; } EXPORT_SYMBOL_GPL(gpiod_direction_input); #ifdef CONFIG_MACH_XIAOMI_MIDO extern int gt9xx_flag; #endif static int _gpiod_direction_output_raw(struct gpio_desc *desc, int value) { Loading @@ -996,6 +1002,7 @@ static int _gpiod_direction_output_raw(struct gpio_desc *desc, int value) int status = -EINVAL; /* GPIOs used for IRQs shall not be set as output */ #ifdef CONFIG_MACH_XIAOMI_MIDO if ((special_irq == 1) && (gt9xx_flag == 1)) { printk("[GPIO]set GPIO_65 as irq output\n"); } else{ Loading @@ -1006,7 +1013,14 @@ static int _gpiod_direction_output_raw(struct gpio_desc *desc, int value) return -EIO; } } #else if (test_bit(FLAG_USED_AS_IRQ, &desc->flags)) { gpiod_err(desc, "%s: tried to set a GPIO tied to an IRQ as output\n", __func__); return -EIO; } #endif /* Open drain pin should not be driven to 1 */ if (value && test_bit(FLAG_OPEN_DRAIN, &desc->flags)) return gpiod_direction_input(desc); Loading
sound/soc/msm/msm8952.c +8 −2 Original line number Diff line number Diff line Loading @@ -96,6 +96,7 @@ static struct wcd_mbhc_config mbhc_cfg = { .mono_stero_detection = false, .swap_gnd_mic = NULL, .hs_ext_micbias = false, #ifdef CONFIG_MACH_XIAOMI_MSM8953 #ifdef CONFIG_MACH_XIAOMI_MIDO .key_code[0] = KEY_MEDIA, .key_code[1] = BTN_1, Loading @@ -105,7 +106,8 @@ static struct wcd_mbhc_config mbhc_cfg = { .key_code[5] = 0, .key_code[6] = 0, .key_code[7] = 0, #else ifdef CONFIG_MACH_XIAOMI_MARKW #endif #ifdef CONFIG_MACH_XIAOMI_MARKW .key_code[0] = KEY_MEDIA, .key_code[1] = KEY_PREVIOUSSONG_NEW, .key_code[2] = KEY_NEXTSONG_NEW, Loading @@ -114,6 +116,7 @@ static struct wcd_mbhc_config mbhc_cfg = { .key_code[5] = 0, .key_code[6] = 0, .key_code[7] = 0, #endif #else .key_code[0] = KEY_MEDIA, .key_code[1] = KEY_VOICECOMMAND, Loading Loading @@ -1615,6 +1618,7 @@ static void *def_msm8952_wcd_mbhc_cal(void) * 210-290 == Button 2 * 360-680 == Button 3 */ #ifdef CONFIG_MACH_XIAOMI_MSM8953 #ifdef CONFIG_MACH_XIAOMI_MIDO btn_low[0] = 73; btn_high[0] = 73; Loading @@ -1626,7 +1630,8 @@ static void *def_msm8952_wcd_mbhc_cal(void) btn_high[3] = 438; btn_low[4] = 438; btn_high[4] = 438; #else ifdef CONFIG_MACH_XIAOMI_MARKW #endif #ifdef CONFIG_MACH_XIAOMI_MARKW btn_low[0] = 25; btn_high[0] = 75; btn_low[1] = 200; Loading @@ -1637,6 +1642,7 @@ static void *def_msm8952_wcd_mbhc_cal(void) btn_high[3] = 510; btn_low[4] = 530; btn_high[4] = 540; #endif #else btn_low[0] = 75; btn_high[0] = 75; Loading