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 branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mjg59/platform-drivers-x86

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mjg59/platform-drivers-x86:
dell-laptop: Toggle the unsupported hardware killswitch
thinkpad_acpi: Always report scancodes for hotkeys
acer-wmi: Fix capitalisation of GUID
platform/x86: ideapad-laptop depends on INPUT
platform: x86: acer-wmi: world-writable sysfs threeg file
platform: x86: asus_acpi: world-writable procfs files
platform: x86: tc1100-wmi: world-writable sysfs wireless and jogdial files
platform-drivers: x86: pmic: Use request_irq instead of chained handler
platform-drivers: x86: pmic: Use irq_chip buslock mechanism
platform-drivers: x86: Convert pmic to new irq_chip functions
platform-drivers: x86: pmic: Fix up bogus irq hackery

+61 -103
+1 -1
drivers/platform/x86/Kconfig
··· 227 227 config IDEAPAD_LAPTOP 228 228 tristate "Lenovo IdeaPad Laptop Extras" 229 229 depends on ACPI 230 - depends on RFKILL 230 + depends on RFKILL && INPUT 231 231 select INPUT_SPARSEKMAP 232 232 help 233 233 This is a driver for the rfkill switches on Lenovo IdeaPad netbooks.
+2 -2
drivers/platform/x86/acer-wmi.c
··· 84 84 */ 85 85 #define AMW0_GUID1 "67C3371D-95A3-4C37-BB61-DD47B491DAAB" 86 86 #define AMW0_GUID2 "431F16ED-0C2B-444C-B267-27DEB140CF9C" 87 - #define WMID_GUID1 "6AF4F258-B401-42fd-BE91-3D4AC2D7C0D3" 87 + #define WMID_GUID1 "6AF4F258-B401-42FD-BE91-3D4AC2D7C0D3" 88 88 #define WMID_GUID2 "95764E09-FB56-4e83-B31A-37761F60994A" 89 89 #define WMID_GUID3 "61EF69EA-865C-4BC3-A502-A0DEBA0CB531" 90 90 ··· 1280 1280 return -EINVAL; 1281 1281 return count; 1282 1282 } 1283 - static DEVICE_ATTR(threeg, S_IWUGO | S_IRUGO | S_IWUSR, show_bool_threeg, 1283 + static DEVICE_ATTR(threeg, S_IRUGO | S_IWUSR, show_bool_threeg, 1284 1284 set_bool_threeg); 1285 1285 1286 1286 static ssize_t show_interface(struct device *dev, struct device_attribute *attr,
+1 -7
drivers/platform/x86/asus_acpi.c
··· 1081 1081 struct proc_dir_entry *proc; 1082 1082 mode_t mode; 1083 1083 1084 - /* 1085 - * If parameter uid or gid is not changed, keep the default setting for 1086 - * our proc entries (-rw-rw-rw-) else, it means we care about security, 1087 - * and then set to -rw-rw---- 1088 - */ 1089 - 1090 1084 if ((asus_uid == 0) && (asus_gid == 0)) { 1091 - mode = S_IFREG | S_IRUGO | S_IWUGO; 1085 + mode = S_IFREG | S_IRUGO | S_IWUSR | S_IWGRP; 1092 1086 } else { 1093 1087 mode = S_IFREG | S_IRUSR | S_IRGRP | S_IWUSR | S_IWGRP; 1094 1088 printk(KERN_WARNING " asus_uid and asus_gid parameters are "
+22 -2
drivers/platform/x86/dell-laptop.c
··· 290 290 dell_send_request(buffer, 17, 11); 291 291 292 292 /* If the hardware switch controls this radio, and the hardware 293 - switch is disabled, don't allow changing the software state */ 293 + switch is disabled, don't allow changing the software state. 294 + If the hardware switch is reported as not supported, always 295 + fire the SMI to toggle the killswitch. */ 294 296 if ((hwswitch_state & BIT(hwswitch_bit)) && 295 - !(buffer->output[1] & BIT(16))) { 297 + !(buffer->output[1] & BIT(16)) && 298 + (buffer->output[1] & BIT(0))) { 296 299 ret = -EINVAL; 297 300 goto out; 298 301 } ··· 401 398 402 399 static void dell_update_rfkill(struct work_struct *ignored) 403 400 { 401 + int status; 402 + 403 + get_buffer(); 404 + dell_send_request(buffer, 17, 11); 405 + status = buffer->output[1]; 406 + release_buffer(); 407 + 408 + /* if hardware rfkill is not supported, set it explicitly */ 409 + if (!(status & BIT(0))) { 410 + if (wifi_rfkill) 411 + dell_rfkill_set((void *)1, !((status & BIT(17)) >> 17)); 412 + if (bluetooth_rfkill) 413 + dell_rfkill_set((void *)2, !((status & BIT(18)) >> 18)); 414 + if (wwan_rfkill) 415 + dell_rfkill_set((void *)3, !((status & BIT(19)) >> 19)); 416 + } 417 + 404 418 if (wifi_rfkill) 405 419 dell_rfkill_query(wifi_rfkill, (void *)1); 406 420 if (bluetooth_rfkill)
+32 -84
drivers/platform/x86/intel_pmic_gpio.c
··· 60 60 #define GPOSW_DOU 0x08 61 61 #define GPOSW_RDRV 0x30 62 62 63 + #define GPIO_UPDATE_TYPE 0x80000000 63 64 64 65 #define NUM_GPIO 24 65 66 66 - struct pmic_gpio_irq { 67 - spinlock_t lock; 68 - u32 trigger[NUM_GPIO]; 69 - u32 dirty; 70 - struct work_struct work; 71 - }; 72 - 73 - 74 67 struct pmic_gpio { 68 + struct mutex buslock; 75 69 struct gpio_chip chip; 76 - struct pmic_gpio_irq irqtypes; 77 70 void *gpiointr; 78 71 int irq; 79 72 unsigned irq_base; 73 + unsigned int update_type; 74 + u32 trigger_type; 80 75 }; 81 - 82 - static void pmic_program_irqtype(int gpio, int type) 83 - { 84 - if (type & IRQ_TYPE_EDGE_RISING) 85 - intel_scu_ipc_update_register(GPIO0 + gpio, 0x20, 0x20); 86 - else 87 - intel_scu_ipc_update_register(GPIO0 + gpio, 0x00, 0x20); 88 - 89 - if (type & IRQ_TYPE_EDGE_FALLING) 90 - intel_scu_ipc_update_register(GPIO0 + gpio, 0x10, 0x10); 91 - else 92 - intel_scu_ipc_update_register(GPIO0 + gpio, 0x00, 0x10); 93 - }; 94 - 95 - static void pmic_irqtype_work(struct work_struct *work) 96 - { 97 - struct pmic_gpio_irq *t = 98 - container_of(work, struct pmic_gpio_irq, work); 99 - unsigned long flags; 100 - int i; 101 - u16 type; 102 - 103 - spin_lock_irqsave(&t->lock, flags); 104 - /* As we drop the lock, we may need multiple scans if we race the 105 - pmic_irq_type function */ 106 - while (t->dirty) { 107 - /* 108 - * For each pin that has the dirty bit set send an IPC 109 - * message to configure the hardware via the PMIC 110 - */ 111 - for (i = 0; i < NUM_GPIO; i++) { 112 - if (!(t->dirty & (1 << i))) 113 - continue; 114 - t->dirty &= ~(1 << i); 115 - /* We can't trust the array entry or dirty 116 - once the lock is dropped */ 117 - type = t->trigger[i]; 118 - spin_unlock_irqrestore(&t->lock, flags); 119 - pmic_program_irqtype(i, type); 120 - spin_lock_irqsave(&t->lock, flags); 121 - } 122 - } 123 - spin_unlock_irqrestore(&t->lock, flags); 124 - } 125 76 126 77 static int pmic_gpio_direction_input(struct gpio_chip *chip, unsigned offset) 127 78 { ··· 141 190 1 << (offset - 16)); 142 191 } 143 192 144 - static int pmic_irq_type(unsigned irq, unsigned type) 193 + /* 194 + * This is called from genirq with pg->buslock locked and 195 + * irq_desc->lock held. We can not access the scu bus here, so we 196 + * store the change and update in the bus_sync_unlock() function below 197 + */ 198 + static int pmic_irq_type(struct irq_data *data, unsigned type) 145 199 { 146 - struct pmic_gpio *pg = get_irq_chip_data(irq); 147 - u32 gpio = irq - pg->irq_base; 148 - unsigned long flags; 200 + struct pmic_gpio *pg = irq_data_get_irq_chip_data(data); 201 + u32 gpio = data->irq - pg->irq_base; 149 202 150 203 if (gpio >= pg->chip.ngpio) 151 204 return -EINVAL; 152 205 153 - spin_lock_irqsave(&pg->irqtypes.lock, flags); 154 - pg->irqtypes.trigger[gpio] = type; 155 - pg->irqtypes.dirty |= (1 << gpio); 156 - spin_unlock_irqrestore(&pg->irqtypes.lock, flags); 157 - schedule_work(&pg->irqtypes.work); 206 + pg->trigger_type = type; 207 + pg->update_type = gpio | GPIO_UPDATE_TYPE; 158 208 return 0; 159 209 } 160 - 161 - 162 210 163 211 static int pmic_gpio_to_irq(struct gpio_chip *chip, unsigned offset) 164 212 { ··· 167 217 } 168 218 169 219 /* the gpiointr register is read-clear, so just do nothing. */ 170 - static void pmic_irq_unmask(unsigned irq) 171 - { 172 - }; 220 + static void pmic_irq_unmask(struct irq_data *data) { } 173 221 174 - static void pmic_irq_mask(unsigned irq) 175 - { 176 - }; 222 + static void pmic_irq_mask(struct irq_data *data) { } 177 223 178 224 static struct irq_chip pmic_irqchip = { 179 225 .name = "PMIC-GPIO", 180 - .mask = pmic_irq_mask, 181 - .unmask = pmic_irq_unmask, 182 - .set_type = pmic_irq_type, 226 + .irq_mask = pmic_irq_mask, 227 + .irq_unmask = pmic_irq_unmask, 228 + .irq_set_type = pmic_irq_type, 183 229 }; 184 230 185 - static void pmic_irq_handler(unsigned irq, struct irq_desc *desc) 231 + static irqreturn_t pmic_irq_handler(int irq, void *data) 186 232 { 187 - struct pmic_gpio *pg = (struct pmic_gpio *)get_irq_data(irq); 233 + struct pmic_gpio *pg = data; 188 234 u8 intsts = *((u8 *)pg->gpiointr + 4); 189 235 int gpio; 236 + irqreturn_t ret = IRQ_NONE; 190 237 191 238 for (gpio = 0; gpio < 8; gpio++) { 192 239 if (intsts & (1 << gpio)) { 193 240 pr_debug("pmic pin %d triggered\n", gpio); 194 241 generic_handle_irq(pg->irq_base + gpio); 242 + ret = IRQ_HANDLED; 195 243 } 196 244 } 197 - 198 - if (desc->chip->irq_eoi) 199 - desc->chip->irq_eoi(irq_get_irq_data(irq)); 200 - else 201 - dev_warn(pg->chip.dev, "missing EOI handler for irq %d\n", irq); 245 + return ret; 202 246 } 203 247 204 248 static int __devinit platform_pmic_gpio_probe(struct platform_device *pdev) ··· 241 297 pg->chip.can_sleep = 1; 242 298 pg->chip.dev = dev; 243 299 244 - INIT_WORK(&pg->irqtypes.work, pmic_irqtype_work); 245 - spin_lock_init(&pg->irqtypes.lock); 300 + mutex_init(&pg->buslock); 246 301 247 302 pg->chip.dev = dev; 248 303 retval = gpiochip_add(&pg->chip); ··· 249 306 printk(KERN_ERR "%s: Can not add pmic gpio chip.\n", __func__); 250 307 goto err; 251 308 } 252 - set_irq_data(pg->irq, pg); 253 - set_irq_chained_handler(pg->irq, pmic_irq_handler); 309 + 310 + retval = request_irq(pg->irq, pmic_irq_handler, 0, "pmic", pg); 311 + if (retval) { 312 + printk(KERN_WARNING "pmic: Interrupt request failed\n"); 313 + goto err; 314 + } 315 + 254 316 for (i = 0; i < 8; i++) { 255 317 set_irq_chip_and_handler_name(i + pg->irq_base, &pmic_irqchip, 256 318 handle_simple_irq, "demux");
+1 -1
drivers/platform/x86/tc1100-wmi.c
··· 162 162 return -EINVAL; \ 163 163 return count; \ 164 164 } \ 165 - static DEVICE_ATTR(value, S_IWUGO | S_IRUGO | S_IWUSR, \ 165 + static DEVICE_ATTR(value, S_IRUGO | S_IWUSR, \ 166 166 show_bool_##value, set_bool_##value); 167 167 168 168 show_set_bool(wireless, TC1100_INSTANCE_WIRELESS);
+2 -6
drivers/platform/x86/thinkpad_acpi.c
··· 2275 2275 if (keycode != KEY_RESERVED) { 2276 2276 mutex_lock(&tpacpi_inputdev_send_mutex); 2277 2277 2278 + input_event(tpacpi_inputdev, EV_MSC, MSC_SCAN, scancode); 2278 2279 input_report_key(tpacpi_inputdev, keycode, 1); 2279 - if (keycode == KEY_UNKNOWN) 2280 - input_event(tpacpi_inputdev, EV_MSC, MSC_SCAN, 2281 - scancode); 2282 2280 input_sync(tpacpi_inputdev); 2283 2281 2282 + input_event(tpacpi_inputdev, EV_MSC, MSC_SCAN, scancode); 2284 2283 input_report_key(tpacpi_inputdev, keycode, 0); 2285 - if (keycode == KEY_UNKNOWN) 2286 - input_event(tpacpi_inputdev, EV_MSC, MSC_SCAN, 2287 - scancode); 2288 2284 input_sync(tpacpi_inputdev); 2289 2285 2290 2286 mutex_unlock(&tpacpi_inputdev_send_mutex);