Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'gpio-for-v3.11-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio

Pull GPIO fixes from Linus Walleij:
"Yet another GPIO pull request, fixing the fix from the last one. It
turns out that fixing the boot path for device tree boots on OMAP
breaks out antique systems (such as OMAP1) and we need to find a
better way. So we're reverting that "fix" for the moment and thinking
about something better.

Also fixing a build issue on the MSM driver"

* tag 'gpio-for-v3.11-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio:
gpio_msm: Fix build error due to missing err.h
Revert "gpio/omap: don't create an IRQ mapping for every GPIO on DT"
Revert "gpio/omap: auto request GPIO as input if used as IRQ via DT"
Revert "gpio/omap: fix build error when OF_GPIO is not defined."

+15 -70
+1
drivers/gpio/gpio-msm-v1.c
··· 21 21 #include <linux/module.h> 22 22 #include <linux/device.h> 23 23 #include <linux/platform_device.h> 24 + #include <linux/err.h> 24 25 25 26 #include <mach/msm_gpiomux.h> 26 27
+14 -70
drivers/gpio/gpio-omap.c
··· 1037 1037 IRQ_NOREQUEST | IRQ_NOPROBE, 0); 1038 1038 } 1039 1039 1040 - #if defined(CONFIG_OF_GPIO) 1041 - static inline bool omap_gpio_chip_boot_dt(struct gpio_chip *chip) 1042 - { 1043 - return chip->of_node != NULL; 1044 - } 1045 - #else 1046 - static inline bool omap_gpio_chip_boot_dt(struct gpio_chip *chip) 1047 - { 1048 - return false; 1049 - } 1050 - #endif 1051 - 1052 1040 static void omap_gpio_chip_init(struct gpio_bank *bank) 1053 1041 { 1054 1042 int j; ··· 1068 1080 1069 1081 gpiochip_add(&bank->chip); 1070 1082 1071 - /* 1072 - * REVISIT these explicit calls to irq_create_mapping() 1073 - * to do the GPIO to IRQ domain mapping for each GPIO in 1074 - * the bank can be removed once all OMAP platforms have 1075 - * been migrated to Device Tree boot only. 1076 - * Since in DT boot irq_create_mapping() is called from 1077 - * irq_create_of_mapping() only for the GPIO lines that 1078 - * are used as interrupts. 1079 - */ 1080 - if (!omap_gpio_chip_boot_dt(&bank->chip)) 1081 - for (j = 0; j < bank->width; j++) 1082 - irq_create_mapping(bank->domain, j); 1083 + for (j = 0; j < bank->width; j++) { 1084 + int irq = irq_create_mapping(bank->domain, j); 1085 + irq_set_lockdep_class(irq, &gpio_lock_class); 1086 + irq_set_chip_data(irq, bank); 1087 + if (bank->is_mpuio) { 1088 + omap_mpuio_alloc_gc(bank, irq, bank->width); 1089 + } else { 1090 + irq_set_chip_and_handler(irq, &gpio_irq_chip, 1091 + handle_simple_irq); 1092 + set_irq_flags(irq, IRQF_VALID); 1093 + } 1094 + } 1083 1095 irq_set_chained_handler(bank->irq, gpio_irq_handler); 1084 1096 irq_set_handler_data(bank->irq, bank); 1085 1097 } 1086 1098 1087 1099 static const struct of_device_id omap_gpio_match[]; 1088 - 1089 - static int omap_gpio_irq_map(struct irq_domain *d, unsigned int virq, 1090 - irq_hw_number_t hwirq) 1091 - { 1092 - struct gpio_bank *bank = d->host_data; 1093 - int gpio; 1094 - int ret; 1095 - 1096 - if (!bank) 1097 - return -EINVAL; 1098 - 1099 - irq_set_lockdep_class(virq, &gpio_lock_class); 1100 - irq_set_chip_data(virq, bank); 1101 - if (bank->is_mpuio) { 1102 - omap_mpuio_alloc_gc(bank, virq, bank->width); 1103 - } else { 1104 - irq_set_chip_and_handler(virq, &gpio_irq_chip, 1105 - handle_simple_irq); 1106 - set_irq_flags(virq, IRQF_VALID); 1107 - } 1108 - 1109 - /* 1110 - * REVISIT most GPIO IRQ chip drivers need to call 1111 - * gpio_request() before a GPIO line can be used as an 1112 - * IRQ. Ideally this should be handled by the IRQ core 1113 - * but until then this has to be done on a per driver 1114 - * basis. Remove this once this is managed by the core. 1115 - */ 1116 - if (omap_gpio_chip_boot_dt(&bank->chip)) { 1117 - gpio = irq_to_gpio(bank, hwirq); 1118 - ret = gpio_request_one(gpio, GPIOF_IN, NULL); 1119 - if (ret) { 1120 - dev_err(bank->dev, "Could not request GPIO%d\n", gpio); 1121 - return ret; 1122 - } 1123 - } 1124 - 1125 - return 0; 1126 - } 1127 - 1128 - static struct irq_domain_ops omap_gpio_irq_ops = { 1129 - .xlate = irq_domain_xlate_onetwocell, 1130 - .map = omap_gpio_irq_map, 1131 - }; 1132 1100 1133 1101 static int omap_gpio_probe(struct platform_device *pdev) 1134 1102 { ··· 1151 1207 } 1152 1208 1153 1209 bank->domain = irq_domain_add_legacy(node, bank->width, irq_base, 1154 - 0, &omap_gpio_irq_ops, bank); 1210 + 0, &irq_domain_simple_ops, NULL); 1155 1211 #else 1156 1212 bank->domain = irq_domain_add_linear(node, bank->width, 1157 - &omap_gpio_irq_ops, bank); 1213 + &irq_domain_simple_ops, NULL); 1158 1214 #endif 1159 1215 if (!bank->domain) { 1160 1216 dev_err(dev, "Couldn't register an IRQ domain\n");