diff options
Diffstat (limited to 'drivers')
99 files changed, 548 insertions, 1131 deletions
diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c index 821040503154..7025593a58c8 100644 --- a/drivers/amba/bus.c +++ b/drivers/amba/bus.c | |||
| @@ -214,7 +214,7 @@ static int amba_pm_resume_noirq(struct device *dev) | |||
| 214 | 214 | ||
| 215 | #endif /* !CONFIG_SUSPEND */ | 215 | #endif /* !CONFIG_SUSPEND */ |
| 216 | 216 | ||
| 217 | #ifdef CONFIG_HIBERNATION | 217 | #ifdef CONFIG_HIBERNATE_CALLBACKS |
| 218 | 218 | ||
| 219 | static int amba_pm_freeze(struct device *dev) | 219 | static int amba_pm_freeze(struct device *dev) |
| 220 | { | 220 | { |
| @@ -352,7 +352,7 @@ static int amba_pm_restore_noirq(struct device *dev) | |||
| 352 | return ret; | 352 | return ret; |
| 353 | } | 353 | } |
| 354 | 354 | ||
| 355 | #else /* !CONFIG_HIBERNATION */ | 355 | #else /* !CONFIG_HIBERNATE_CALLBACKS */ |
| 356 | 356 | ||
| 357 | #define amba_pm_freeze NULL | 357 | #define amba_pm_freeze NULL |
| 358 | #define amba_pm_thaw NULL | 358 | #define amba_pm_thaw NULL |
| @@ -363,7 +363,7 @@ static int amba_pm_restore_noirq(struct device *dev) | |||
| 363 | #define amba_pm_poweroff_noirq NULL | 363 | #define amba_pm_poweroff_noirq NULL |
| 364 | #define amba_pm_restore_noirq NULL | 364 | #define amba_pm_restore_noirq NULL |
| 365 | 365 | ||
| 366 | #endif /* !CONFIG_HIBERNATION */ | 366 | #endif /* !CONFIG_HIBERNATE_CALLBACKS */ |
| 367 | 367 | ||
| 368 | #ifdef CONFIG_PM | 368 | #ifdef CONFIG_PM |
| 369 | 369 | ||
diff --git a/drivers/base/platform.c b/drivers/base/platform.c index f051cfff18af..9e0e4fc24c46 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c | |||
| @@ -149,6 +149,7 @@ static void platform_device_release(struct device *dev) | |||
| 149 | 149 | ||
| 150 | of_device_node_put(&pa->pdev.dev); | 150 | of_device_node_put(&pa->pdev.dev); |
| 151 | kfree(pa->pdev.dev.platform_data); | 151 | kfree(pa->pdev.dev.platform_data); |
| 152 | kfree(pa->pdev.mfd_cell); | ||
| 152 | kfree(pa->pdev.resource); | 153 | kfree(pa->pdev.resource); |
| 153 | kfree(pa); | 154 | kfree(pa); |
| 154 | } | 155 | } |
| @@ -771,7 +772,7 @@ int __weak platform_pm_resume_noirq(struct device *dev) | |||
| 771 | 772 | ||
| 772 | #endif /* !CONFIG_SUSPEND */ | 773 | #endif /* !CONFIG_SUSPEND */ |
| 773 | 774 | ||
| 774 | #ifdef CONFIG_HIBERNATION | 775 | #ifdef CONFIG_HIBERNATE_CALLBACKS |
| 775 | 776 | ||
| 776 | static int platform_pm_freeze(struct device *dev) | 777 | static int platform_pm_freeze(struct device *dev) |
| 777 | { | 778 | { |
| @@ -909,7 +910,7 @@ static int platform_pm_restore_noirq(struct device *dev) | |||
| 909 | return ret; | 910 | return ret; |
| 910 | } | 911 | } |
| 911 | 912 | ||
| 912 | #else /* !CONFIG_HIBERNATION */ | 913 | #else /* !CONFIG_HIBERNATE_CALLBACKS */ |
| 913 | 914 | ||
| 914 | #define platform_pm_freeze NULL | 915 | #define platform_pm_freeze NULL |
| 915 | #define platform_pm_thaw NULL | 916 | #define platform_pm_thaw NULL |
| @@ -920,7 +921,7 @@ static int platform_pm_restore_noirq(struct device *dev) | |||
| 920 | #define platform_pm_poweroff_noirq NULL | 921 | #define platform_pm_poweroff_noirq NULL |
| 921 | #define platform_pm_restore_noirq NULL | 922 | #define platform_pm_restore_noirq NULL |
| 922 | 923 | ||
| 923 | #endif /* !CONFIG_HIBERNATION */ | 924 | #endif /* !CONFIG_HIBERNATE_CALLBACKS */ |
| 924 | 925 | ||
| 925 | #ifdef CONFIG_PM_RUNTIME | 926 | #ifdef CONFIG_PM_RUNTIME |
| 926 | 927 | ||
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c index 052dc53eef38..fbc5b6e7c591 100644 --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c | |||
| @@ -233,7 +233,7 @@ static int pm_op(struct device *dev, | |||
| 233 | } | 233 | } |
| 234 | break; | 234 | break; |
| 235 | #endif /* CONFIG_SUSPEND */ | 235 | #endif /* CONFIG_SUSPEND */ |
| 236 | #ifdef CONFIG_HIBERNATION | 236 | #ifdef CONFIG_HIBERNATE_CALLBACKS |
| 237 | case PM_EVENT_FREEZE: | 237 | case PM_EVENT_FREEZE: |
| 238 | case PM_EVENT_QUIESCE: | 238 | case PM_EVENT_QUIESCE: |
| 239 | if (ops->freeze) { | 239 | if (ops->freeze) { |
| @@ -260,7 +260,7 @@ static int pm_op(struct device *dev, | |||
| 260 | suspend_report_result(ops->restore, error); | 260 | suspend_report_result(ops->restore, error); |
| 261 | } | 261 | } |
| 262 | break; | 262 | break; |
| 263 | #endif /* CONFIG_HIBERNATION */ | 263 | #endif /* CONFIG_HIBERNATE_CALLBACKS */ |
| 264 | default: | 264 | default: |
| 265 | error = -EINVAL; | 265 | error = -EINVAL; |
| 266 | } | 266 | } |
| @@ -308,7 +308,7 @@ static int pm_noirq_op(struct device *dev, | |||
| 308 | } | 308 | } |
| 309 | break; | 309 | break; |
| 310 | #endif /* CONFIG_SUSPEND */ | 310 | #endif /* CONFIG_SUSPEND */ |
| 311 | #ifdef CONFIG_HIBERNATION | 311 | #ifdef CONFIG_HIBERNATE_CALLBACKS |
| 312 | case PM_EVENT_FREEZE: | 312 | case PM_EVENT_FREEZE: |
| 313 | case PM_EVENT_QUIESCE: | 313 | case PM_EVENT_QUIESCE: |
| 314 | if (ops->freeze_noirq) { | 314 | if (ops->freeze_noirq) { |
| @@ -335,7 +335,7 @@ static int pm_noirq_op(struct device *dev, | |||
| 335 | suspend_report_result(ops->restore_noirq, error); | 335 | suspend_report_result(ops->restore_noirq, error); |
| 336 | } | 336 | } |
| 337 | break; | 337 | break; |
| 338 | #endif /* CONFIG_HIBERNATION */ | 338 | #endif /* CONFIG_HIBERNATE_CALLBACKS */ |
| 339 | default: | 339 | default: |
| 340 | error = -EINVAL; | 340 | error = -EINVAL; |
| 341 | } | 341 | } |
diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c index 6b396759e7f5..8a781540590c 100644 --- a/drivers/dma/fsldma.c +++ b/drivers/dma/fsldma.c | |||
| @@ -1448,7 +1448,7 @@ static const struct of_device_id fsldma_of_ids[] = { | |||
| 1448 | {} | 1448 | {} |
| 1449 | }; | 1449 | }; |
| 1450 | 1450 | ||
| 1451 | static struct of_platform_driver fsldma_of_driver = { | 1451 | static struct platform_driver fsldma_of_driver = { |
| 1452 | .driver = { | 1452 | .driver = { |
| 1453 | .name = "fsl-elo-dma", | 1453 | .name = "fsl-elo-dma", |
| 1454 | .owner = THIS_MODULE, | 1454 | .owner = THIS_MODULE, |
diff --git a/drivers/gpio/ml_ioh_gpio.c b/drivers/gpio/ml_ioh_gpio.c index 7f6f01a4b145..0a775f7987c2 100644 --- a/drivers/gpio/ml_ioh_gpio.c +++ b/drivers/gpio/ml_ioh_gpio.c | |||
| @@ -116,6 +116,7 @@ static int ioh_gpio_direction_output(struct gpio_chip *gpio, unsigned nr, | |||
| 116 | reg_val |= (1 << nr); | 116 | reg_val |= (1 << nr); |
| 117 | else | 117 | else |
| 118 | reg_val &= ~(1 << nr); | 118 | reg_val &= ~(1 << nr); |
| 119 | iowrite32(reg_val, &chip->reg->regs[chip->ch].po); | ||
| 119 | 120 | ||
| 120 | mutex_unlock(&chip->lock); | 121 | mutex_unlock(&chip->lock); |
| 121 | 122 | ||
diff --git a/drivers/gpio/pca953x.c b/drivers/gpio/pca953x.c index 583e92592073..7630ab7b9bec 100644 --- a/drivers/gpio/pca953x.c +++ b/drivers/gpio/pca953x.c | |||
| @@ -558,7 +558,7 @@ static int __devinit pca953x_probe(struct i2c_client *client, | |||
| 558 | 558 | ||
| 559 | ret = gpiochip_add(&chip->gpio_chip); | 559 | ret = gpiochip_add(&chip->gpio_chip); |
| 560 | if (ret) | 560 | if (ret) |
| 561 | goto out_failed; | 561 | goto out_failed_irq; |
| 562 | 562 | ||
| 563 | if (pdata->setup) { | 563 | if (pdata->setup) { |
| 564 | ret = pdata->setup(client, chip->gpio_chip.base, | 564 | ret = pdata->setup(client, chip->gpio_chip.base, |
| @@ -570,8 +570,9 @@ static int __devinit pca953x_probe(struct i2c_client *client, | |||
| 570 | i2c_set_clientdata(client, chip); | 570 | i2c_set_clientdata(client, chip); |
| 571 | return 0; | 571 | return 0; |
| 572 | 572 | ||
| 573 | out_failed: | 573 | out_failed_irq: |
| 574 | pca953x_irq_teardown(chip); | 574 | pca953x_irq_teardown(chip); |
| 575 | out_failed: | ||
| 575 | kfree(chip->dyn_pdata); | 576 | kfree(chip->dyn_pdata); |
| 576 | kfree(chip); | 577 | kfree(chip); |
| 577 | return ret; | 578 | return ret; |
diff --git a/drivers/gpio/pch_gpio.c b/drivers/gpio/pch_gpio.c index 2c6af8705103..f970a5f3585e 100644 --- a/drivers/gpio/pch_gpio.c +++ b/drivers/gpio/pch_gpio.c | |||
| @@ -105,6 +105,7 @@ static int pch_gpio_direction_output(struct gpio_chip *gpio, unsigned nr, | |||
| 105 | reg_val |= (1 << nr); | 105 | reg_val |= (1 << nr); |
| 106 | else | 106 | else |
| 107 | reg_val &= ~(1 << nr); | 107 | reg_val &= ~(1 << nr); |
| 108 | iowrite32(reg_val, &chip->reg->po); | ||
| 108 | 109 | ||
| 109 | mutex_unlock(&chip->lock); | 110 | mutex_unlock(&chip->lock); |
| 110 | 111 | ||
diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig index a6feb78c404c..c58f691ec3ce 100644 --- a/drivers/gpu/drm/Kconfig +++ b/drivers/gpu/drm/Kconfig | |||
| @@ -96,6 +96,7 @@ config DRM_I915 | |||
| 96 | # i915 depends on ACPI_VIDEO when ACPI is enabled | 96 | # i915 depends on ACPI_VIDEO when ACPI is enabled |
| 97 | # but for select to work, need to select ACPI_VIDEO's dependencies, ick | 97 | # but for select to work, need to select ACPI_VIDEO's dependencies, ick |
| 98 | select BACKLIGHT_CLASS_DEVICE if ACPI | 98 | select BACKLIGHT_CLASS_DEVICE if ACPI |
| 99 | select VIDEO_OUTPUT_CONTROL if ACPI | ||
| 99 | select INPUT if ACPI | 100 | select INPUT if ACPI |
| 100 | select ACPI_VIDEO if ACPI | 101 | select ACPI_VIDEO if ACPI |
| 101 | select ACPI_BUTTON if ACPI | 102 | select ACPI_BUTTON if ACPI |
diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c b/drivers/gpu/drm/nouveau/nouveau_bios.c index 8314a49b6b9a..90aef64b76f2 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bios.c +++ b/drivers/gpu/drm/nouveau/nouveau_bios.c | |||
| @@ -269,7 +269,7 @@ struct init_tbl_entry { | |||
| 269 | int (*handler)(struct nvbios *, uint16_t, struct init_exec *); | 269 | int (*handler)(struct nvbios *, uint16_t, struct init_exec *); |
| 270 | }; | 270 | }; |
| 271 | 271 | ||
| 272 | static int parse_init_table(struct nvbios *, unsigned int, struct init_exec *); | 272 | static int parse_init_table(struct nvbios *, uint16_t, struct init_exec *); |
| 273 | 273 | ||
| 274 | #define MACRO_INDEX_SIZE 2 | 274 | #define MACRO_INDEX_SIZE 2 |
| 275 | #define MACRO_SIZE 8 | 275 | #define MACRO_SIZE 8 |
| @@ -2011,6 +2011,27 @@ init_sub_direct(struct nvbios *bios, uint16_t offset, struct init_exec *iexec) | |||
| 2011 | } | 2011 | } |
| 2012 | 2012 | ||
| 2013 | static int | 2013 | static int |
| 2014 | init_jump(struct nvbios *bios, uint16_t offset, struct init_exec *iexec) | ||
| 2015 | { | ||
| 2016 | /* | ||
| 2017 | * INIT_JUMP opcode: 0x5C ('\') | ||
| 2018 | * | ||
| 2019 | * offset (8 bit): opcode | ||
| 2020 | * offset + 1 (16 bit): offset (in bios) | ||
| 2021 | * | ||
| 2022 | * Continue execution of init table from 'offset' | ||
| 2023 | */ | ||
| 2024 | |||
| 2025 | uint16_t jmp_offset = ROM16(bios->data[offset + 1]); | ||
| 2026 | |||
| 2027 | if (!iexec->execute) | ||
| 2028 | return 3; | ||
| 2029 | |||
| 2030 | BIOSLOG(bios, "0x%04X: Jump to 0x%04X\n", offset, jmp_offset); | ||
| 2031 | return jmp_offset - offset; | ||
| 2032 | } | ||
| 2033 | |||
| 2034 | static int | ||
| 2014 | init_i2c_if(struct nvbios *bios, uint16_t offset, struct init_exec *iexec) | 2035 | init_i2c_if(struct nvbios *bios, uint16_t offset, struct init_exec *iexec) |
| 2015 | { | 2036 | { |
| 2016 | /* | 2037 | /* |
| @@ -3659,6 +3680,7 @@ static struct init_tbl_entry itbl_entry[] = { | |||
| 3659 | { "INIT_ZM_REG_SEQUENCE" , 0x58, init_zm_reg_sequence }, | 3680 | { "INIT_ZM_REG_SEQUENCE" , 0x58, init_zm_reg_sequence }, |
| 3660 | /* INIT_INDIRECT_REG (0x5A, 7, 0, 0) removed due to no example of use */ | 3681 | /* INIT_INDIRECT_REG (0x5A, 7, 0, 0) removed due to no example of use */ |
| 3661 | { "INIT_SUB_DIRECT" , 0x5B, init_sub_direct }, | 3682 | { "INIT_SUB_DIRECT" , 0x5B, init_sub_direct }, |
| 3683 | { "INIT_JUMP" , 0x5C, init_jump }, | ||
| 3662 | { "INIT_I2C_IF" , 0x5E, init_i2c_if }, | 3684 | { "INIT_I2C_IF" , 0x5E, init_i2c_if }, |
| 3663 | { "INIT_COPY_NV_REG" , 0x5F, init_copy_nv_reg }, | 3685 | { "INIT_COPY_NV_REG" , 0x5F, init_copy_nv_reg }, |
| 3664 | { "INIT_ZM_INDEX_IO" , 0x62, init_zm_index_io }, | 3686 | { "INIT_ZM_INDEX_IO" , 0x62, init_zm_index_io }, |
| @@ -3700,8 +3722,7 @@ static struct init_tbl_entry itbl_entry[] = { | |||
| 3700 | #define MAX_TABLE_OPS 1000 | 3722 | #define MAX_TABLE_OPS 1000 |
| 3701 | 3723 | ||
| 3702 | static int | 3724 | static int |
| 3703 | parse_init_table(struct nvbios *bios, unsigned int offset, | 3725 | parse_init_table(struct nvbios *bios, uint16_t offset, struct init_exec *iexec) |
| 3704 | struct init_exec *iexec) | ||
| 3705 | { | 3726 | { |
| 3706 | /* | 3727 | /* |
| 3707 | * Parses all commands in an init table. | 3728 | * Parses all commands in an init table. |
| @@ -6333,6 +6354,32 @@ apply_dcb_encoder_quirks(struct drm_device *dev, int idx, u32 *conn, u32 *conf) | |||
| 6333 | } | 6354 | } |
| 6334 | } | 6355 | } |
| 6335 | 6356 | ||
| 6357 | /* XFX GT-240X-YA | ||
| 6358 | * | ||
| 6359 | * So many things wrong here, replace the entire encoder table.. | ||
| 6360 | */ | ||
| 6361 | if (nv_match_device(dev, 0x0ca3, 0x1682, 0x3003)) { | ||
| 6362 | if (idx == 0) { | ||
| 6363 | *conn = 0x02001300; /* VGA, connector 1 */ | ||
| 6364 | *conf = 0x00000028; | ||
| 6365 | } else | ||
| 6366 | if (idx == 1) { | ||
| 6367 | *conn = 0x01010312; /* DVI, connector 0 */ | ||
| 6368 | *conf = 0x00020030; | ||
| 6369 | } else | ||
| 6370 | if (idx == 2) { | ||
| 6371 | *conn = 0x01010310; /* VGA, connector 0 */ | ||
| 6372 | *conf = 0x00000028; | ||
| 6373 | } else | ||
| 6374 | if (idx == 3) { | ||
| 6375 | *conn = 0x02022362; /* HDMI, connector 2 */ | ||
| 6376 | *conf = 0x00020010; | ||
| 6377 | } else { | ||
| 6378 | *conn = 0x0000000e; /* EOL */ | ||
| 6379 | *conf = 0x00000000; | ||
| 6380 | } | ||
| 6381 | } | ||
| 6382 | |||
| 6336 | return true; | 6383 | return true; |
| 6337 | } | 6384 | } |
| 6338 | 6385 | ||
diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.h b/drivers/gpu/drm/nouveau/nouveau_drv.h index 57e5302503db..856d56a98d1e 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drv.h +++ b/drivers/gpu/drm/nouveau/nouveau_drv.h | |||
| @@ -1190,7 +1190,7 @@ extern int nv50_graph_load_context(struct nouveau_channel *); | |||
| 1190 | extern int nv50_graph_unload_context(struct drm_device *); | 1190 | extern int nv50_graph_unload_context(struct drm_device *); |
| 1191 | extern int nv50_grctx_init(struct nouveau_grctx *); | 1191 | extern int nv50_grctx_init(struct nouveau_grctx *); |
| 1192 | extern void nv50_graph_tlb_flush(struct drm_device *dev); | 1192 | extern void nv50_graph_tlb_flush(struct drm_device *dev); |
| 1193 | extern void nv86_graph_tlb_flush(struct drm_device *dev); | 1193 | extern void nv84_graph_tlb_flush(struct drm_device *dev); |
| 1194 | extern struct nouveau_enum nv50_data_error_names[]; | 1194 | extern struct nouveau_enum nv50_data_error_names[]; |
| 1195 | 1195 | ||
| 1196 | /* nvc0_graph.c */ | 1196 | /* nvc0_graph.c */ |
diff --git a/drivers/gpu/drm/nouveau/nouveau_mem.c b/drivers/gpu/drm/nouveau/nouveau_mem.c index 2683377f4131..78f467fe30be 100644 --- a/drivers/gpu/drm/nouveau/nouveau_mem.c +++ b/drivers/gpu/drm/nouveau/nouveau_mem.c | |||
| @@ -552,6 +552,7 @@ nouveau_mem_timing_init(struct drm_device *dev) | |||
| 552 | u8 tRC; /* Byte 9 */ | 552 | u8 tRC; /* Byte 9 */ |
| 553 | u8 tUNK_10, tUNK_11, tUNK_12, tUNK_13, tUNK_14; | 553 | u8 tUNK_10, tUNK_11, tUNK_12, tUNK_13, tUNK_14; |
| 554 | u8 tUNK_18, tUNK_19, tUNK_20, tUNK_21; | 554 | u8 tUNK_18, tUNK_19, tUNK_20, tUNK_21; |
| 555 | u8 magic_number = 0; /* Yeah... sorry*/ | ||
| 555 | u8 *mem = NULL, *entry; | 556 | u8 *mem = NULL, *entry; |
| 556 | int i, recordlen, entries; | 557 | int i, recordlen, entries; |
| 557 | 558 | ||
| @@ -596,6 +597,12 @@ nouveau_mem_timing_init(struct drm_device *dev) | |||
| 596 | if (!memtimings->timing) | 597 | if (!memtimings->timing) |
| 597 | return; | 598 | return; |
| 598 | 599 | ||
| 600 | /* Get "some number" from the timing reg for NV_40 | ||
| 601 | * Used in calculations later */ | ||
| 602 | if(dev_priv->card_type == NV_40) { | ||
| 603 | magic_number = (nv_rd32(dev,0x100228) & 0x0f000000) >> 24; | ||
| 604 | } | ||
| 605 | |||
| 599 | entry = mem + mem[1]; | 606 | entry = mem + mem[1]; |
| 600 | for (i = 0; i < entries; i++, entry += recordlen) { | 607 | for (i = 0; i < entries; i++, entry += recordlen) { |
| 601 | struct nouveau_pm_memtiming *timing = &pm->memtimings.timing[i]; | 608 | struct nouveau_pm_memtiming *timing = &pm->memtimings.timing[i]; |
| @@ -635,36 +642,51 @@ nouveau_mem_timing_init(struct drm_device *dev) | |||
| 635 | 642 | ||
| 636 | /* XXX: I don't trust the -1's and +1's... they must come | 643 | /* XXX: I don't trust the -1's and +1's... they must come |
| 637 | * from somewhere! */ | 644 | * from somewhere! */ |
| 638 | timing->reg_100224 = ((tUNK_0 + tUNK_19 + 1) << 24 | | 645 | timing->reg_100224 = (tUNK_0 + tUNK_19 + 1 + magic_number) << 24 | |
| 639 | tUNK_18 << 16 | | 646 | tUNK_18 << 16 | |
| 640 | (tUNK_1 + tUNK_19 + 1) << 8 | | 647 | (tUNK_1 + tUNK_19 + 1 + magic_number) << 8; |
| 641 | (tUNK_2 - 1)); | 648 | if(dev_priv->chipset == 0xa8) { |
| 649 | timing->reg_100224 |= (tUNK_2 - 1); | ||
| 650 | } else { | ||
| 651 | timing->reg_100224 |= (tUNK_2 + 2 - magic_number); | ||
| 652 | } | ||
| 642 | 653 | ||
| 643 | timing->reg_100228 = (tUNK_12 << 16 | tUNK_11 << 8 | tUNK_10); | 654 | timing->reg_100228 = (tUNK_12 << 16 | tUNK_11 << 8 | tUNK_10); |
| 644 | if(recordlen > 19) { | 655 | if(dev_priv->chipset >= 0xa3 && dev_priv->chipset < 0xaa) { |
| 645 | timing->reg_100228 += (tUNK_19 - 1) << 24; | 656 | timing->reg_100228 |= (tUNK_19 - 1) << 24; |
| 646 | }/* I cannot back-up this else-statement right now | 657 | } |
| 647 | else { | 658 | |
| 648 | timing->reg_100228 += tUNK_12 << 24; | 659 | if(dev_priv->card_type == NV_40) { |
| 649 | }*/ | 660 | /* NV40: don't know what the rest of the regs are.. |
| 650 | 661 | * And don't need to know either */ | |
| 651 | /* XXX: reg_10022c */ | 662 | timing->reg_100228 |= 0x20200000 | magic_number << 24; |
| 652 | timing->reg_10022c = tUNK_2 - 1; | 663 | } else if(dev_priv->card_type >= NV_50) { |
| 653 | 664 | /* XXX: reg_10022c */ | |
| 654 | timing->reg_100230 = (tUNK_20 << 24 | tUNK_21 << 16 | | 665 | timing->reg_10022c = tUNK_2 - 1; |
| 655 | tUNK_13 << 8 | tUNK_13); | 666 | |
| 656 | 667 | timing->reg_100230 = (tUNK_20 << 24 | tUNK_21 << 16 | | |
| 657 | /* XXX: +6? */ | 668 | tUNK_13 << 8 | tUNK_13); |
| 658 | timing->reg_100234 = (tRAS << 24 | (tUNK_19 + 6) << 8 | tRC); | 669 | |
| 659 | timing->reg_100234 += max(tUNK_10,tUNK_11) << 16; | 670 | timing->reg_100234 = (tRAS << 24 | tRC); |
| 660 | 671 | timing->reg_100234 += max(tUNK_10,tUNK_11) << 16; | |
| 661 | /* XXX; reg_100238, reg_10023c | 672 | |
| 662 | * reg: 0x00?????? | 673 | if(dev_priv->chipset < 0xa3) { |
| 663 | * reg_10023c: | 674 | timing->reg_100234 |= (tUNK_2 + 2) << 8; |
| 664 | * 0 for pre-NV50 cards | 675 | } else { |
| 665 | * 0x????0202 for NV50+ cards (empirical evidence) */ | 676 | /* XXX: +6? */ |
| 666 | if(dev_priv->card_type >= NV_50) { | 677 | timing->reg_100234 |= (tUNK_19 + 6) << 8; |
| 678 | } | ||
| 679 | |||
| 680 | /* XXX; reg_100238, reg_10023c | ||
| 681 | * reg_100238: 0x00?????? | ||
| 682 | * reg_10023c: 0x!!??0202 for NV50+ cards (empirical evidence) */ | ||
| 667 | timing->reg_10023c = 0x202; | 683 | timing->reg_10023c = 0x202; |
| 684 | if(dev_priv->chipset < 0xa3) { | ||
| 685 | timing->reg_10023c |= 0x4000000 | (tUNK_2 - 1) << 16; | ||
| 686 | } else { | ||
| 687 | /* currently unknown | ||
| 688 | * 10023c seen as 06xxxxxx, 0bxxxxxx or 0fxxxxxx */ | ||
| 689 | } | ||
| 668 | } | 690 | } |
| 669 | 691 | ||
| 670 | NV_DEBUG(dev, "Entry %d: 220: %08x %08x %08x %08x\n", i, | 692 | NV_DEBUG(dev, "Entry %d: 220: %08x %08x %08x %08x\n", i, |
| @@ -675,7 +697,7 @@ nouveau_mem_timing_init(struct drm_device *dev) | |||
| 675 | timing->reg_100238, timing->reg_10023c); | 697 | timing->reg_100238, timing->reg_10023c); |
| 676 | } | 698 | } |
| 677 | 699 | ||
| 678 | memtimings->nr_timing = entries; | 700 | memtimings->nr_timing = entries; |
| 679 | memtimings->supported = true; | 701 | memtimings->supported = true; |
| 680 | } | 702 | } |
| 681 | 703 | ||
diff --git a/drivers/gpu/drm/nouveau/nouveau_perf.c b/drivers/gpu/drm/nouveau/nouveau_perf.c index ac62a1b8c4fc..670e3cb697ec 100644 --- a/drivers/gpu/drm/nouveau/nouveau_perf.c +++ b/drivers/gpu/drm/nouveau/nouveau_perf.c | |||
| @@ -134,7 +134,7 @@ nouveau_perf_init(struct drm_device *dev) | |||
| 134 | case 0x13: | 134 | case 0x13: |
| 135 | case 0x15: | 135 | case 0x15: |
| 136 | perflvl->fanspeed = entry[55]; | 136 | perflvl->fanspeed = entry[55]; |
| 137 | perflvl->voltage = entry[56]; | 137 | perflvl->voltage = (recordlen > 56) ? entry[56] : 0; |
| 138 | perflvl->core = ROM32(entry[1]) * 10; | 138 | perflvl->core = ROM32(entry[1]) * 10; |
| 139 | perflvl->memory = ROM32(entry[5]) * 20; | 139 | perflvl->memory = ROM32(entry[5]) * 20; |
| 140 | break; | 140 | break; |
diff --git a/drivers/gpu/drm/nouveau/nouveau_state.c b/drivers/gpu/drm/nouveau/nouveau_state.c index 5bb2859001e2..6e2b1a6caa2d 100644 --- a/drivers/gpu/drm/nouveau/nouveau_state.c +++ b/drivers/gpu/drm/nouveau/nouveau_state.c | |||
| @@ -376,15 +376,11 @@ static int nouveau_init_engine_ptrs(struct drm_device *dev) | |||
| 376 | engine->graph.destroy_context = nv50_graph_destroy_context; | 376 | engine->graph.destroy_context = nv50_graph_destroy_context; |
| 377 | engine->graph.load_context = nv50_graph_load_context; | 377 | engine->graph.load_context = nv50_graph_load_context; |
| 378 | engine->graph.unload_context = nv50_graph_unload_context; | 378 | engine->graph.unload_context = nv50_graph_unload_context; |
| 379 | if (dev_priv->chipset != 0x86) | 379 | if (dev_priv->chipset == 0x50 || |
| 380 | dev_priv->chipset == 0xac) | ||
| 380 | engine->graph.tlb_flush = nv50_graph_tlb_flush; | 381 | engine->graph.tlb_flush = nv50_graph_tlb_flush; |
| 381 | else { | 382 | else |
| 382 | /* from what i can see nvidia do this on every | 383 | engine->graph.tlb_flush = nv84_graph_tlb_flush; |
| 383 | * pre-NVA3 board except NVAC, but, we've only | ||
| 384 | * ever seen problems on NV86 | ||
| 385 | */ | ||
| 386 | engine->graph.tlb_flush = nv86_graph_tlb_flush; | ||
| 387 | } | ||
| 388 | engine->fifo.channels = 128; | 384 | engine->fifo.channels = 128; |
| 389 | engine->fifo.init = nv50_fifo_init; | 385 | engine->fifo.init = nv50_fifo_init; |
| 390 | engine->fifo.takedown = nv50_fifo_takedown; | 386 | engine->fifo.takedown = nv50_fifo_takedown; |
diff --git a/drivers/gpu/drm/nouveau/nv04_dfp.c b/drivers/gpu/drm/nouveau/nv04_dfp.c index c82db37d9f41..12098bf839c4 100644 --- a/drivers/gpu/drm/nouveau/nv04_dfp.c +++ b/drivers/gpu/drm/nouveau/nv04_dfp.c | |||
| @@ -581,12 +581,13 @@ static void nv04_dfp_restore(struct drm_encoder *encoder) | |||
| 581 | int head = nv_encoder->restore.head; | 581 | int head = nv_encoder->restore.head; |
| 582 | 582 | ||
| 583 | if (nv_encoder->dcb->type == OUTPUT_LVDS) { | 583 | if (nv_encoder->dcb->type == OUTPUT_LVDS) { |
| 584 | struct drm_display_mode *native_mode = nouveau_encoder_connector_get(nv_encoder)->native_mode; | 584 | struct nouveau_connector *connector = |
| 585 | if (native_mode) | 585 | nouveau_encoder_connector_get(nv_encoder); |
| 586 | call_lvds_script(dev, nv_encoder->dcb, head, LVDS_PANEL_ON, | 586 | |
| 587 | native_mode->clock); | 587 | if (connector && connector->native_mode) |
| 588 | else | 588 | call_lvds_script(dev, nv_encoder->dcb, head, |
| 589 | NV_ERROR(dev, "Not restoring LVDS without native mode\n"); | 589 | LVDS_PANEL_ON, |
| 590 | connector->native_mode->clock); | ||
| 590 | 591 | ||
| 591 | } else if (nv_encoder->dcb->type == OUTPUT_TMDS) { | 592 | } else if (nv_encoder->dcb->type == OUTPUT_TMDS) { |
| 592 | int clock = nouveau_hw_pllvals_to_clk | 593 | int clock = nouveau_hw_pllvals_to_clk |
diff --git a/drivers/gpu/drm/nouveau/nv50_crtc.c b/drivers/gpu/drm/nouveau/nv50_crtc.c index 2b9984027f41..a19ccaa025b3 100644 --- a/drivers/gpu/drm/nouveau/nv50_crtc.c +++ b/drivers/gpu/drm/nouveau/nv50_crtc.c | |||
| @@ -469,9 +469,6 @@ nv50_crtc_wait_complete(struct drm_crtc *crtc) | |||
| 469 | 469 | ||
| 470 | start = ptimer->read(dev); | 470 | start = ptimer->read(dev); |
| 471 | do { | 471 | do { |
| 472 | nv_wr32(dev, 0x61002c, 0x370); | ||
| 473 | nv_wr32(dev, 0x000140, 1); | ||
| 474 | |||
| 475 | if (nv_ro32(disp->ntfy, 0x000)) | 472 | if (nv_ro32(disp->ntfy, 0x000)) |
| 476 | return 0; | 473 | return 0; |
| 477 | } while (ptimer->read(dev) - start < 2000000000ULL); | 474 | } while (ptimer->read(dev) - start < 2000000000ULL); |
diff --git a/drivers/gpu/drm/nouveau/nv50_evo.c b/drivers/gpu/drm/nouveau/nv50_evo.c index a2cfaa691e9b..c8e83c1a4de8 100644 --- a/drivers/gpu/drm/nouveau/nv50_evo.c +++ b/drivers/gpu/drm/nouveau/nv50_evo.c | |||
| @@ -186,6 +186,7 @@ nv50_evo_channel_init(struct nouveau_channel *evo) | |||
| 186 | nv_mask(dev, 0x610028, 0x00000000, 0x00010001 << id); | 186 | nv_mask(dev, 0x610028, 0x00000000, 0x00010001 << id); |
| 187 | 187 | ||
| 188 | evo->dma.max = (4096/4) - 2; | 188 | evo->dma.max = (4096/4) - 2; |
| 189 | evo->dma.max &= ~7; | ||
| 189 | evo->dma.put = 0; | 190 | evo->dma.put = 0; |
| 190 | evo->dma.cur = evo->dma.put; | 191 | evo->dma.cur = evo->dma.put; |
| 191 | evo->dma.free = evo->dma.max - evo->dma.cur; | 192 | evo->dma.free = evo->dma.max - evo->dma.cur; |
diff --git a/drivers/gpu/drm/nouveau/nv50_graph.c b/drivers/gpu/drm/nouveau/nv50_graph.c index 8675b00caf18..b02a5b1e7d37 100644 --- a/drivers/gpu/drm/nouveau/nv50_graph.c +++ b/drivers/gpu/drm/nouveau/nv50_graph.c | |||
| @@ -503,7 +503,7 @@ nv50_graph_tlb_flush(struct drm_device *dev) | |||
| 503 | } | 503 | } |
| 504 | 504 | ||
| 505 | void | 505 | void |
| 506 | nv86_graph_tlb_flush(struct drm_device *dev) | 506 | nv84_graph_tlb_flush(struct drm_device *dev) |
| 507 | { | 507 | { |
| 508 | struct drm_nouveau_private *dev_priv = dev->dev_private; | 508 | struct drm_nouveau_private *dev_priv = dev->dev_private; |
| 509 | struct nouveau_timer_engine *ptimer = &dev_priv->engine.timer; | 509 | struct nouveau_timer_engine *ptimer = &dev_priv->engine.timer; |
diff --git a/drivers/gpu/drm/nouveau/nvc0_vm.c b/drivers/gpu/drm/nouveau/nvc0_vm.c index 69af0ba7edd3..a0a2a0277f73 100644 --- a/drivers/gpu/drm/nouveau/nvc0_vm.c +++ b/drivers/gpu/drm/nouveau/nvc0_vm.c | |||
| @@ -104,20 +104,26 @@ nvc0_vm_flush(struct nouveau_vm *vm) | |||
| 104 | struct nouveau_instmem_engine *pinstmem = &dev_priv->engine.instmem; | 104 | struct nouveau_instmem_engine *pinstmem = &dev_priv->engine.instmem; |
| 105 | struct drm_device *dev = vm->dev; | 105 | struct drm_device *dev = vm->dev; |
| 106 | struct nouveau_vm_pgd *vpgd; | 106 | struct nouveau_vm_pgd *vpgd; |
| 107 | u32 r100c80, engine; | 107 | u32 engine = (dev_priv->chan_vm == vm) ? 1 : 5; |
| 108 | 108 | ||
| 109 | pinstmem->flush(vm->dev); | 109 | pinstmem->flush(vm->dev); |
| 110 | 110 | ||
| 111 | if (vm == dev_priv->chan_vm) | 111 | spin_lock(&dev_priv->ramin_lock); |
| 112 | engine = 1; | ||
| 113 | else | ||
| 114 | engine = 5; | ||
| 115 | |||
| 116 | list_for_each_entry(vpgd, &vm->pgd_list, head) { | 112 | list_for_each_entry(vpgd, &vm->pgd_list, head) { |
| 117 | r100c80 = nv_rd32(dev, 0x100c80); | 113 | /* looks like maybe a "free flush slots" counter, the |
| 114 | * faster you write to 0x100cbc to more it decreases | ||
| 115 | */ | ||
| 116 | if (!nv_wait_ne(dev, 0x100c80, 0x00ff0000, 0x00000000)) { | ||
| 117 | NV_ERROR(dev, "vm timeout 0: 0x%08x %d\n", | ||
| 118 | nv_rd32(dev, 0x100c80), engine); | ||
| 119 | } | ||
| 118 | nv_wr32(dev, 0x100cb8, vpgd->obj->vinst >> 8); | 120 | nv_wr32(dev, 0x100cb8, vpgd->obj->vinst >> 8); |
| 119 | nv_wr32(dev, 0x100cbc, 0x80000000 | engine); | 121 | nv_wr32(dev, 0x100cbc, 0x80000000 | engine); |
| 120 | if (!nv_wait(dev, 0x100c80, 0xffffffff, r100c80)) | 122 | /* wait for flush to be queued? */ |
| 121 | NV_ERROR(dev, "vm flush timeout eng %d\n", engine); | 123 | if (!nv_wait(dev, 0x100c80, 0x00008000, 0x00008000)) { |
| 124 | NV_ERROR(dev, "vm timeout 1: 0x%08x %d\n", | ||
| 125 | nv_rd32(dev, 0x100c80), engine); | ||
| 126 | } | ||
| 122 | } | 127 | } |
| 128 | spin_unlock(&dev_priv->ramin_lock); | ||
| 123 | } | 129 | } |
diff --git a/drivers/gpu/drm/radeon/atom.c b/drivers/gpu/drm/radeon/atom.c index 258fa5e7a2d9..d71d375149f8 100644 --- a/drivers/gpu/drm/radeon/atom.c +++ b/drivers/gpu/drm/radeon/atom.c | |||
| @@ -32,6 +32,7 @@ | |||
| 32 | #include "atom.h" | 32 | #include "atom.h" |
| 33 | #include "atom-names.h" | 33 | #include "atom-names.h" |
| 34 | #include "atom-bits.h" | 34 | #include "atom-bits.h" |
| 35 | #include "radeon.h" | ||
| 35 | 36 | ||
| 36 | #define ATOM_COND_ABOVE 0 | 37 | #define ATOM_COND_ABOVE 0 |
| 37 | #define ATOM_COND_ABOVEOREQUAL 1 | 38 | #define ATOM_COND_ABOVEOREQUAL 1 |
| @@ -101,7 +102,9 @@ static void debug_print_spaces(int n) | |||
| 101 | static uint32_t atom_iio_execute(struct atom_context *ctx, int base, | 102 | static uint32_t atom_iio_execute(struct atom_context *ctx, int base, |
| 102 | uint32_t index, uint32_t data) | 103 | uint32_t index, uint32_t data) |
| 103 | { | 104 | { |
| 105 | struct radeon_device *rdev = ctx->card->dev->dev_private; | ||
| 104 | uint32_t temp = 0xCDCDCDCD; | 106 | uint32_t temp = 0xCDCDCDCD; |
| 107 | |||
| 105 | while (1) | 108 | while (1) |
| 106 | switch (CU8(base)) { | 109 | switch (CU8(base)) { |
| 107 | case ATOM_IIO_NOP: | 110 | case ATOM_IIO_NOP: |
| @@ -112,7 +115,8 @@ static uint32_t atom_iio_execute(struct atom_context *ctx, int base, | |||
| 112 | base += 3; | 115 | base += 3; |
| 113 | break; | 116 | break; |
| 114 | case ATOM_IIO_WRITE: | 117 | case ATOM_IIO_WRITE: |
| 115 | (void)ctx->card->ioreg_read(ctx->card, CU16(base + 1)); | 118 | if (rdev->family == CHIP_RV515) |
| 119 | (void)ctx->card->ioreg_read(ctx->card, CU16(base + 1)); | ||
| 116 | ctx->card->ioreg_write(ctx->card, CU16(base + 1), temp); | 120 | ctx->card->ioreg_write(ctx->card, CU16(base + 1), temp); |
| 117 | base += 3; | 121 | base += 3; |
| 118 | break; | 122 | break; |
diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c b/drivers/gpu/drm/radeon/atombios_crtc.c index b41ec59c7100..9d516a8c4dfa 100644 --- a/drivers/gpu/drm/radeon/atombios_crtc.c +++ b/drivers/gpu/drm/radeon/atombios_crtc.c | |||
| @@ -531,6 +531,12 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc, | |||
| 531 | pll->flags |= RADEON_PLL_PREFER_HIGH_FB_DIV; | 531 | pll->flags |= RADEON_PLL_PREFER_HIGH_FB_DIV; |
| 532 | else | 532 | else |
| 533 | pll->flags |= RADEON_PLL_PREFER_LOW_REF_DIV; | 533 | pll->flags |= RADEON_PLL_PREFER_LOW_REF_DIV; |
| 534 | |||
| 535 | if ((rdev->family == CHIP_R600) || | ||
| 536 | (rdev->family == CHIP_RV610) || | ||
| 537 | (rdev->family == CHIP_RV630) || | ||
| 538 | (rdev->family == CHIP_RV670)) | ||
| 539 | pll->flags |= RADEON_PLL_PREFER_MINM_OVER_MAXP; | ||
| 534 | } else { | 540 | } else { |
| 535 | pll->flags |= RADEON_PLL_LEGACY; | 541 | pll->flags |= RADEON_PLL_LEGACY; |
| 536 | 542 | ||
diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c index 0b0cc74c08c0..3453910ee0f3 100644 --- a/drivers/gpu/drm/radeon/evergreen.c +++ b/drivers/gpu/drm/radeon/evergreen.c | |||
| @@ -120,11 +120,16 @@ void evergreen_pm_misc(struct radeon_device *rdev) | |||
| 120 | struct radeon_power_state *ps = &rdev->pm.power_state[req_ps_idx]; | 120 | struct radeon_power_state *ps = &rdev->pm.power_state[req_ps_idx]; |
| 121 | struct radeon_voltage *voltage = &ps->clock_info[req_cm_idx].voltage; | 121 | struct radeon_voltage *voltage = &ps->clock_info[req_cm_idx].voltage; |
| 122 | 122 | ||
| 123 | if ((voltage->type == VOLTAGE_SW) && voltage->voltage) { | 123 | if (voltage->type == VOLTAGE_SW) { |
| 124 | if (voltage->voltage != rdev->pm.current_vddc) { | 124 | if (voltage->voltage && (voltage->voltage != rdev->pm.current_vddc)) { |
| 125 | radeon_atom_set_voltage(rdev, voltage->voltage); | 125 | radeon_atom_set_voltage(rdev, voltage->voltage, SET_VOLTAGE_TYPE_ASIC_VDDC); |
| 126 | rdev->pm.current_vddc = voltage->voltage; | 126 | rdev->pm.current_vddc = voltage->voltage; |
| 127 | DRM_DEBUG("Setting: v: %d\n", voltage->voltage); | 127 | DRM_DEBUG("Setting: vddc: %d\n", voltage->voltage); |
| 128 | } | ||
| 129 | if (voltage->vddci && (voltage->vddci != rdev->pm.current_vddci)) { | ||
| 130 | radeon_atom_set_voltage(rdev, voltage->vddci, SET_VOLTAGE_TYPE_ASIC_VDDCI); | ||
| 131 | rdev->pm.current_vddci = voltage->vddci; | ||
| 132 | DRM_DEBUG("Setting: vddci: %d\n", voltage->vddci); | ||
| 128 | } | 133 | } |
| 129 | } | 134 | } |
| 130 | } | 135 | } |
| @@ -3036,9 +3041,6 @@ int evergreen_init(struct radeon_device *rdev) | |||
| 3036 | { | 3041 | { |
| 3037 | int r; | 3042 | int r; |
| 3038 | 3043 | ||
| 3039 | r = radeon_dummy_page_init(rdev); | ||
| 3040 | if (r) | ||
| 3041 | return r; | ||
| 3042 | /* This don't do much */ | 3044 | /* This don't do much */ |
| 3043 | r = radeon_gem_init(rdev); | 3045 | r = radeon_gem_init(rdev); |
| 3044 | if (r) | 3046 | if (r) |
| @@ -3150,7 +3152,6 @@ void evergreen_fini(struct radeon_device *rdev) | |||
| 3150 | radeon_atombios_fini(rdev); | 3152 | radeon_atombios_fini(rdev); |
| 3151 | kfree(rdev->bios); | 3153 | kfree(rdev->bios); |
| 3152 | rdev->bios = NULL; | 3154 | rdev->bios = NULL; |
| 3153 | radeon_dummy_page_fini(rdev); | ||
| 3154 | } | 3155 | } |
| 3155 | 3156 | ||
| 3156 | static void evergreen_pcie_gen2_enable(struct radeon_device *rdev) | 3157 | static void evergreen_pcie_gen2_enable(struct radeon_device *rdev) |
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c index be271c42de4d..15d58292677a 100644 --- a/drivers/gpu/drm/radeon/r600.c +++ b/drivers/gpu/drm/radeon/r600.c | |||
| @@ -587,7 +587,7 @@ void r600_pm_misc(struct radeon_device *rdev) | |||
| 587 | 587 | ||
| 588 | if ((voltage->type == VOLTAGE_SW) && voltage->voltage) { | 588 | if ((voltage->type == VOLTAGE_SW) && voltage->voltage) { |
| 589 | if (voltage->voltage != rdev->pm.current_vddc) { | 589 | if (voltage->voltage != rdev->pm.current_vddc) { |
| 590 | radeon_atom_set_voltage(rdev, voltage->voltage); | 590 | radeon_atom_set_voltage(rdev, voltage->voltage, SET_VOLTAGE_TYPE_ASIC_VDDC); |
| 591 | rdev->pm.current_vddc = voltage->voltage; | 591 | rdev->pm.current_vddc = voltage->voltage; |
| 592 | DRM_DEBUG_DRIVER("Setting: v: %d\n", voltage->voltage); | 592 | DRM_DEBUG_DRIVER("Setting: v: %d\n", voltage->voltage); |
| 593 | } | 593 | } |
| @@ -2509,9 +2509,6 @@ int r600_init(struct radeon_device *rdev) | |||
| 2509 | { | 2509 | { |
| 2510 | int r; | 2510 | int r; |
| 2511 | 2511 | ||
| 2512 | r = radeon_dummy_page_init(rdev); | ||
| 2513 | if (r) | ||
| 2514 | return r; | ||
| 2515 | if (r600_debugfs_mc_info_init(rdev)) { | 2512 | if (r600_debugfs_mc_info_init(rdev)) { |
| 2516 | DRM_ERROR("Failed to register debugfs file for mc !\n"); | 2513 | DRM_ERROR("Failed to register debugfs file for mc !\n"); |
| 2517 | } | 2514 | } |
| @@ -2625,7 +2622,6 @@ void r600_fini(struct radeon_device *rdev) | |||
| 2625 | radeon_atombios_fini(rdev); | 2622 | radeon_atombios_fini(rdev); |
| 2626 | kfree(rdev->bios); | 2623 | kfree(rdev->bios); |
| 2627 | rdev->bios = NULL; | 2624 | rdev->bios = NULL; |
| 2628 | radeon_dummy_page_fini(rdev); | ||
| 2629 | } | 2625 | } |
| 2630 | 2626 | ||
| 2631 | 2627 | ||
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h index 93f536594c73..ba643b576054 100644 --- a/drivers/gpu/drm/radeon/radeon.h +++ b/drivers/gpu/drm/radeon/radeon.h | |||
| @@ -177,7 +177,7 @@ void radeon_pm_suspend(struct radeon_device *rdev); | |||
| 177 | void radeon_pm_resume(struct radeon_device *rdev); | 177 | void radeon_pm_resume(struct radeon_device *rdev); |
| 178 | void radeon_combios_get_power_modes(struct radeon_device *rdev); | 178 | void radeon_combios_get_power_modes(struct radeon_device *rdev); |
| 179 | void radeon_atombios_get_power_modes(struct radeon_device *rdev); | 179 | void radeon_atombios_get_power_modes(struct radeon_device *rdev); |
| 180 | void radeon_atom_set_voltage(struct radeon_device *rdev, u16 level); | 180 | void radeon_atom_set_voltage(struct radeon_device *rdev, u16 voltage_level, u8 voltage_type); |
| 181 | void rs690_pm_info(struct radeon_device *rdev); | 181 | void rs690_pm_info(struct radeon_device *rdev); |
| 182 | extern int rv6xx_get_temp(struct radeon_device *rdev); | 182 | extern int rv6xx_get_temp(struct radeon_device *rdev); |
| 183 | extern int rv770_get_temp(struct radeon_device *rdev); | 183 | extern int rv770_get_temp(struct radeon_device *rdev); |
| @@ -767,7 +767,9 @@ struct radeon_voltage { | |||
| 767 | u8 vddci_id; /* index into vddci voltage table */ | 767 | u8 vddci_id; /* index into vddci voltage table */ |
| 768 | bool vddci_enabled; | 768 | bool vddci_enabled; |
| 769 | /* r6xx+ sw */ | 769 | /* r6xx+ sw */ |
| 770 | u32 voltage; | 770 | u16 voltage; |
| 771 | /* evergreen+ vddci */ | ||
| 772 | u16 vddci; | ||
| 771 | }; | 773 | }; |
| 772 | 774 | ||
| 773 | /* clock mode flags */ | 775 | /* clock mode flags */ |
| @@ -835,10 +837,12 @@ struct radeon_pm { | |||
| 835 | int default_power_state_index; | 837 | int default_power_state_index; |
| 836 | u32 current_sclk; | 838 | u32 current_sclk; |
| 837 | u32 current_mclk; | 839 | u32 current_mclk; |
| 838 | u32 current_vddc; | 840 | u16 current_vddc; |
| 841 | u16 current_vddci; | ||
| 839 | u32 default_sclk; | 842 | u32 default_sclk; |
| 840 | u32 default_mclk; | 843 | u32 default_mclk; |
| 841 | u32 default_vddc; | 844 | u16 default_vddc; |
| 845 | u16 default_vddci; | ||
| 842 | struct radeon_i2c_chan *i2c_bus; | 846 | struct radeon_i2c_chan *i2c_bus; |
| 843 | /* selected pm method */ | 847 | /* selected pm method */ |
| 844 | enum radeon_pm_method pm_method; | 848 | enum radeon_pm_method pm_method; |
diff --git a/drivers/gpu/drm/radeon/radeon_asic.c b/drivers/gpu/drm/radeon/radeon_asic.c index eb888ee5f674..ca576191d058 100644 --- a/drivers/gpu/drm/radeon/radeon_asic.c +++ b/drivers/gpu/drm/radeon/radeon_asic.c | |||
| @@ -94,7 +94,7 @@ static void radeon_register_accessor_init(struct radeon_device *rdev) | |||
| 94 | rdev->mc_rreg = &rs600_mc_rreg; | 94 | rdev->mc_rreg = &rs600_mc_rreg; |
| 95 | rdev->mc_wreg = &rs600_mc_wreg; | 95 | rdev->mc_wreg = &rs600_mc_wreg; |
| 96 | } | 96 | } |
| 97 | if ((rdev->family >= CHIP_R600) && (rdev->family <= CHIP_HEMLOCK)) { | 97 | if (rdev->family >= CHIP_R600) { |
| 98 | rdev->pciep_rreg = &r600_pciep_rreg; | 98 | rdev->pciep_rreg = &r600_pciep_rreg; |
| 99 | rdev->pciep_wreg = &r600_pciep_wreg; | 99 | rdev->pciep_wreg = &r600_pciep_wreg; |
| 100 | } | 100 | } |
diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c index 99768d9d91da..f5d12fb103fa 100644 --- a/drivers/gpu/drm/radeon/radeon_atombios.c +++ b/drivers/gpu/drm/radeon/radeon_atombios.c | |||
| @@ -2176,24 +2176,27 @@ static void radeon_atombios_add_pplib_thermal_controller(struct radeon_device *r | |||
| 2176 | } | 2176 | } |
| 2177 | } | 2177 | } |
| 2178 | 2178 | ||
| 2179 | static u16 radeon_atombios_get_default_vddc(struct radeon_device *rdev) | 2179 | static void radeon_atombios_get_default_voltages(struct radeon_device *rdev, |
| 2180 | u16 *vddc, u16 *vddci) | ||
| 2180 | { | 2181 | { |
| 2181 | struct radeon_mode_info *mode_info = &rdev->mode_info; | 2182 | struct radeon_mode_info *mode_info = &rdev->mode_info; |
| 2182 | int index = GetIndexIntoMasterTable(DATA, FirmwareInfo); | 2183 | int index = GetIndexIntoMasterTable(DATA, FirmwareInfo); |
| 2183 | u8 frev, crev; | 2184 | u8 frev, crev; |
| 2184 | u16 data_offset; | 2185 | u16 data_offset; |
| 2185 | union firmware_info *firmware_info; | 2186 | union firmware_info *firmware_info; |
| 2186 | u16 vddc = 0; | 2187 | |
| 2188 | *vddc = 0; | ||
| 2189 | *vddci = 0; | ||
| 2187 | 2190 | ||
| 2188 | if (atom_parse_data_header(mode_info->atom_context, index, NULL, | 2191 | if (atom_parse_data_header(mode_info->atom_context, index, NULL, |
| 2189 | &frev, &crev, &data_offset)) { | 2192 | &frev, &crev, &data_offset)) { |
| 2190 | firmware_info = | 2193 | firmware_info = |
| 2191 | (union firmware_info *)(mode_info->atom_context->bios + | 2194 | (union firmware_info *)(mode_info->atom_context->bios + |
| 2192 | data_offset); | 2195 | data_offset); |
| 2193 | vddc = le16_to_cpu(firmware_info->info_14.usBootUpVDDCVoltage); | 2196 | *vddc = le16_to_cpu(firmware_info->info_14.usBootUpVDDCVoltage); |
| 2197 | if ((frev == 2) && (crev >= 2)) | ||
| 2198 | *vddci = le16_to_cpu(firmware_info->info_22.usBootUpVDDCIVoltage); | ||
| 2194 | } | 2199 | } |
| 2195 | |||
| 2196 | return vddc; | ||
| 2197 | } | 2200 | } |
| 2198 | 2201 | ||
| 2199 | static void radeon_atombios_parse_pplib_non_clock_info(struct radeon_device *rdev, | 2202 | static void radeon_atombios_parse_pplib_non_clock_info(struct radeon_device *rdev, |
| @@ -2203,7 +2206,9 @@ static void radeon_atombios_parse_pplib_non_clock_info(struct radeon_device *rde | |||
| 2203 | int j; | 2206 | int j; |
| 2204 | u32 misc = le32_to_cpu(non_clock_info->ulCapsAndSettings); | 2207 | u32 misc = le32_to_cpu(non_clock_info->ulCapsAndSettings); |
| 2205 | u32 misc2 = le16_to_cpu(non_clock_info->usClassification); | 2208 | u32 misc2 = le16_to_cpu(non_clock_info->usClassification); |
| 2206 | u16 vddc = radeon_atombios_get_default_vddc(rdev); | 2209 | u16 vddc, vddci; |
| 2210 | |||
| 2211 | radeon_atombios_get_default_voltages(rdev, &vddc, &vddci); | ||
| 2207 | 2212 | ||
| 2208 | rdev->pm.power_state[state_index].misc = misc; | 2213 | rdev->pm.power_state[state_index].misc = misc; |
| 2209 | rdev->pm.power_state[state_index].misc2 = misc2; | 2214 | rdev->pm.power_state[state_index].misc2 = misc2; |
| @@ -2244,6 +2249,7 @@ static void radeon_atombios_parse_pplib_non_clock_info(struct radeon_device *rde | |||
| 2244 | rdev->pm.default_sclk = rdev->pm.power_state[state_index].clock_info[0].sclk; | 2249 | rdev->pm.default_sclk = rdev->pm.power_state[state_index].clock_info[0].sclk; |
| 2245 | rdev->pm.default_mclk = rdev->pm.power_state[state_index].clock_info[0].mclk; | 2250 | rdev->pm.default_mclk = rdev->pm.power_state[state_index].clock_info[0].mclk; |
| 2246 | rdev->pm.default_vddc = rdev->pm.power_state[state_index].clock_info[0].voltage.voltage; | 2251 | rdev->pm.default_vddc = rdev->pm.power_state[state_index].clock_info[0].voltage.voltage; |
| 2252 | rdev->pm.default_vddci = rdev->pm.power_state[state_index].clock_info[0].voltage.vddci; | ||
| 2247 | } else { | 2253 | } else { |
| 2248 | /* patch the table values with the default slck/mclk from firmware info */ | 2254 | /* patch the table values with the default slck/mclk from firmware info */ |
| 2249 | for (j = 0; j < mode_index; j++) { | 2255 | for (j = 0; j < mode_index; j++) { |
| @@ -2286,6 +2292,8 @@ static bool radeon_atombios_parse_pplib_clock_info(struct radeon_device *rdev, | |||
| 2286 | VOLTAGE_SW; | 2292 | VOLTAGE_SW; |
| 2287 | rdev->pm.power_state[state_index].clock_info[mode_index].voltage.voltage = | 2293 | rdev->pm.power_state[state_index].clock_info[mode_index].voltage.voltage = |
| 2288 | le16_to_cpu(clock_info->evergreen.usVDDC); | 2294 | le16_to_cpu(clock_info->evergreen.usVDDC); |
| 2295 | rdev->pm.power_state[state_index].clock_info[mode_index].voltage.vddci = | ||
| 2296 | le16_to_cpu(clock_info->evergreen.usVDDCI); | ||
| 2289 | } else { | 2297 | } else { |
| 2290 | sclk = le16_to_cpu(clock_info->r600.usEngineClockLow); | 2298 | sclk = le16_to_cpu(clock_info->r600.usEngineClockLow); |
| 2291 | sclk |= clock_info->r600.ucEngineClockHigh << 16; | 2299 | sclk |= clock_info->r600.ucEngineClockHigh << 16; |
| @@ -2577,25 +2585,25 @@ union set_voltage { | |||
| 2577 | struct _SET_VOLTAGE_PARAMETERS_V2 v2; | 2585 | struct _SET_VOLTAGE_PARAMETERS_V2 v2; |
| 2578 | }; | 2586 | }; |
| 2579 | 2587 | ||
| 2580 | void radeon_atom_set_voltage(struct radeon_device *rdev, u16 level) | 2588 | void radeon_atom_set_voltage(struct radeon_device *rdev, u16 voltage_level, u8 voltage_type) |
| 2581 | { | 2589 | { |
| 2582 | union set_voltage args; | 2590 | union set_voltage args; |
| 2583 | int index = GetIndexIntoMasterTable(COMMAND, SetVoltage); | 2591 | int index = GetIndexIntoMasterTable(COMMAND, SetVoltage); |
| 2584 | u8 frev, crev, volt_index = level; | 2592 | u8 frev, crev, volt_index = voltage_level; |
| 2585 | 2593 | ||
| 2586 | if (!atom_parse_cmd_header(rdev->mode_info.atom_context, index, &frev, &crev)) | 2594 | if (!atom_parse_cmd_header(rdev->mode_info.atom_context, index, &frev, &crev)) |
| 2587 | return; | 2595 | return; |
| 2588 | 2596 | ||
| 2589 | switch (crev) { | 2597 | switch (crev) { |
| 2590 | case 1: | 2598 | case 1: |
| 2591 | args.v1.ucVoltageType = SET_VOLTAGE_TYPE_ASIC_VDDC; | 2599 | args.v1.ucVoltageType = voltage_type; |
| 2592 | args.v1.ucVoltageMode = SET_ASIC_VOLTAGE_MODE_ALL_SOURCE; | 2600 | args.v1.ucVoltageMode = SET_ASIC_VOLTAGE_MODE_ALL_SOURCE; |
| 2593 | args.v1.ucVoltageIndex = volt_index; | 2601 | args.v1.ucVoltageIndex = volt_index; |
| 2594 | break; | 2602 | break; |
| 2595 | case 2: | 2603 | case 2: |
| 2596 | args.v2.ucVoltageType = SET_VOLTAGE_TYPE_ASIC_VDDC; | 2604 | args.v2.ucVoltageType = voltage_type; |
| 2597 | args.v2.ucVoltageMode = SET_ASIC_VOLTAGE_MODE_SET_VOLTAGE; | 2605 | args.v2.ucVoltageMode = SET_ASIC_VOLTAGE_MODE_SET_VOLTAGE; |
| 2598 | args.v2.usVoltageLevel = cpu_to_le16(level); | 2606 | args.v2.usVoltageLevel = cpu_to_le16(voltage_level); |
| 2599 | break; | 2607 | break; |
| 2600 | default: | 2608 | default: |
| 2601 | DRM_ERROR("Unknown table version %d, %d\n", frev, crev); | 2609 | DRM_ERROR("Unknown table version %d, %d\n", frev, crev); |
diff --git a/drivers/gpu/drm/radeon/radeon_fence.c b/drivers/gpu/drm/radeon/radeon_fence.c index 9e59868d354e..bbcd1dd7bac0 100644 --- a/drivers/gpu/drm/radeon/radeon_fence.c +++ b/drivers/gpu/drm/radeon/radeon_fence.c | |||
| @@ -79,7 +79,7 @@ static bool radeon_fence_poll_locked(struct radeon_device *rdev) | |||
| 79 | scratch_index = R600_WB_EVENT_OFFSET + rdev->fence_drv.scratch_reg - rdev->scratch.reg_base; | 79 | scratch_index = R600_WB_EVENT_OFFSET + rdev->fence_drv.scratch_reg - rdev->scratch.reg_base; |
| 80 | else | 80 | else |
| 81 | scratch_index = RADEON_WB_SCRATCH_OFFSET + rdev->fence_drv.scratch_reg - rdev->scratch.reg_base; | 81 | scratch_index = RADEON_WB_SCRATCH_OFFSET + rdev->fence_drv.scratch_reg - rdev->scratch.reg_base; |
| 82 | seq = rdev->wb.wb[scratch_index/4]; | 82 | seq = le32_to_cpu(rdev->wb.wb[scratch_index/4]); |
| 83 | } else | 83 | } else |
| 84 | seq = RREG32(rdev->fence_drv.scratch_reg); | 84 | seq = RREG32(rdev->fence_drv.scratch_reg); |
| 85 | if (seq != rdev->fence_drv.last_seq) { | 85 | if (seq != rdev->fence_drv.last_seq) { |
diff --git a/drivers/gpu/drm/radeon/radeon_gart.c b/drivers/gpu/drm/radeon/radeon_gart.c index f0534ef2f331..8a955bbdb608 100644 --- a/drivers/gpu/drm/radeon/radeon_gart.c +++ b/drivers/gpu/drm/radeon/radeon_gart.c | |||
| @@ -285,4 +285,6 @@ void radeon_gart_fini(struct radeon_device *rdev) | |||
| 285 | rdev->gart.pages = NULL; | 285 | rdev->gart.pages = NULL; |
| 286 | rdev->gart.pages_addr = NULL; | 286 | rdev->gart.pages_addr = NULL; |
| 287 | rdev->gart.ttm_alloced = NULL; | 287 | rdev->gart.ttm_alloced = NULL; |
| 288 | |||
| 289 | radeon_dummy_page_fini(rdev); | ||
| 288 | } | 290 | } |
diff --git a/drivers/gpu/drm/radeon/radeon_i2c.c b/drivers/gpu/drm/radeon/radeon_i2c.c index ded2a45bc95c..ccbabf734a61 100644 --- a/drivers/gpu/drm/radeon/radeon_i2c.c +++ b/drivers/gpu/drm/radeon/radeon_i2c.c | |||
| @@ -1062,7 +1062,7 @@ void radeon_i2c_get_byte(struct radeon_i2c_chan *i2c_bus, | |||
| 1062 | *val = in_buf[0]; | 1062 | *val = in_buf[0]; |
| 1063 | DRM_DEBUG("val = 0x%02x\n", *val); | 1063 | DRM_DEBUG("val = 0x%02x\n", *val); |
| 1064 | } else { | 1064 | } else { |
| 1065 | DRM_ERROR("i2c 0x%02x 0x%02x read failed\n", | 1065 | DRM_DEBUG("i2c 0x%02x 0x%02x read failed\n", |
| 1066 | addr, *val); | 1066 | addr, *val); |
| 1067 | } | 1067 | } |
| 1068 | } | 1068 | } |
| @@ -1084,7 +1084,7 @@ void radeon_i2c_put_byte(struct radeon_i2c_chan *i2c_bus, | |||
| 1084 | out_buf[1] = val; | 1084 | out_buf[1] = val; |
| 1085 | 1085 | ||
| 1086 | if (i2c_transfer(&i2c_bus->adapter, &msg, 1) != 1) | 1086 | if (i2c_transfer(&i2c_bus->adapter, &msg, 1) != 1) |
| 1087 | DRM_ERROR("i2c 0x%02x 0x%02x write failed\n", | 1087 | DRM_DEBUG("i2c 0x%02x 0x%02x write failed\n", |
| 1088 | addr, val); | 1088 | addr, val); |
| 1089 | } | 1089 | } |
| 1090 | 1090 | ||
diff --git a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c index 5b54268ed6b2..2f46e0c8df53 100644 --- a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c +++ b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c | |||
| @@ -269,7 +269,7 @@ static const struct drm_encoder_helper_funcs radeon_legacy_lvds_helper_funcs = { | |||
| 269 | .disable = radeon_legacy_encoder_disable, | 269 | .disable = radeon_legacy_encoder_disable, |
| 270 | }; | 270 | }; |
| 271 | 271 | ||
| 272 | #ifdef CONFIG_BACKLIGHT_CLASS_DEVICE | 272 | #if defined(CONFIG_BACKLIGHT_CLASS_DEVICE) || defined(CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE) |
| 273 | 273 | ||
| 274 | #define MAX_RADEON_LEVEL 0xFF | 274 | #define MAX_RADEON_LEVEL 0xFF |
| 275 | 275 | ||
diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c index 08de669e025a..86eda1ea94df 100644 --- a/drivers/gpu/drm/radeon/radeon_pm.c +++ b/drivers/gpu/drm/radeon/radeon_pm.c | |||
| @@ -23,6 +23,7 @@ | |||
| 23 | #include "drmP.h" | 23 | #include "drmP.h" |
| 24 | #include "radeon.h" | 24 | #include "radeon.h" |
| 25 | #include "avivod.h" | 25 | #include "avivod.h" |
| 26 | #include "atom.h" | ||
| 26 | #ifdef CONFIG_ACPI | 27 | #ifdef CONFIG_ACPI |
| 27 | #include <linux/acpi.h> | 28 | #include <linux/acpi.h> |
| 28 | #endif | 29 | #endif |
| @@ -535,7 +536,11 @@ void radeon_pm_resume(struct radeon_device *rdev) | |||
| 535 | /* set up the default clocks if the MC ucode is loaded */ | 536 | /* set up the default clocks if the MC ucode is loaded */ |
| 536 | if (ASIC_IS_DCE5(rdev) && rdev->mc_fw) { | 537 | if (ASIC_IS_DCE5(rdev) && rdev->mc_fw) { |
| 537 | if (rdev->pm.default_vddc) | 538 | if (rdev->pm.default_vddc) |
| 538 | radeon_atom_set_voltage(rdev, rdev->pm.default_vddc); | 539 | radeon_atom_set_voltage(rdev, rdev->pm.default_vddc, |
| 540 | SET_VOLTAGE_TYPE_ASIC_VDDC); | ||
| 541 | if (rdev->pm.default_vddci) | ||
| 542 | radeon_atom_set_voltage(rdev, rdev->pm.default_vddci, | ||
| 543 | SET_VOLTAGE_TYPE_ASIC_VDDCI); | ||
| 539 | if (rdev->pm.default_sclk) | 544 | if (rdev->pm.default_sclk) |
| 540 | radeon_set_engine_clock(rdev, rdev->pm.default_sclk); | 545 | radeon_set_engine_clock(rdev, rdev->pm.default_sclk); |
| 541 | if (rdev->pm.default_mclk) | 546 | if (rdev->pm.default_mclk) |
| @@ -548,6 +553,7 @@ void radeon_pm_resume(struct radeon_device *rdev) | |||
| 548 | rdev->pm.current_sclk = rdev->pm.default_sclk; | 553 | rdev->pm.current_sclk = rdev->pm.default_sclk; |
| 549 | rdev->pm.current_mclk = rdev->pm.default_mclk; | 554 | rdev->pm.current_mclk = rdev->pm.default_mclk; |
| 550 | rdev->pm.current_vddc = rdev->pm.power_state[rdev->pm.default_power_state_index].clock_info[0].voltage.voltage; | 555 | rdev->pm.current_vddc = rdev->pm.power_state[rdev->pm.default_power_state_index].clock_info[0].voltage.voltage; |
| 556 | rdev->pm.current_vddci = rdev->pm.power_state[rdev->pm.default_power_state_index].clock_info[0].voltage.vddci; | ||
| 551 | if (rdev->pm.pm_method == PM_METHOD_DYNPM | 557 | if (rdev->pm.pm_method == PM_METHOD_DYNPM |
| 552 | && rdev->pm.dynpm_state == DYNPM_STATE_SUSPENDED) { | 558 | && rdev->pm.dynpm_state == DYNPM_STATE_SUSPENDED) { |
| 553 | rdev->pm.dynpm_state = DYNPM_STATE_ACTIVE; | 559 | rdev->pm.dynpm_state = DYNPM_STATE_ACTIVE; |
| @@ -585,7 +591,8 @@ int radeon_pm_init(struct radeon_device *rdev) | |||
| 585 | /* set up the default clocks if the MC ucode is loaded */ | 591 | /* set up the default clocks if the MC ucode is loaded */ |
| 586 | if (ASIC_IS_DCE5(rdev) && rdev->mc_fw) { | 592 | if (ASIC_IS_DCE5(rdev) && rdev->mc_fw) { |
| 587 | if (rdev->pm.default_vddc) | 593 | if (rdev->pm.default_vddc) |
| 588 | radeon_atom_set_voltage(rdev, rdev->pm.default_vddc); | 594 | radeon_atom_set_voltage(rdev, rdev->pm.default_vddc, |
| 595 | SET_VOLTAGE_TYPE_ASIC_VDDC); | ||
| 589 | if (rdev->pm.default_sclk) | 596 | if (rdev->pm.default_sclk) |
| 590 | radeon_set_engine_clock(rdev, rdev->pm.default_sclk); | 597 | radeon_set_engine_clock(rdev, rdev->pm.default_sclk); |
| 591 | if (rdev->pm.default_mclk) | 598 | if (rdev->pm.default_mclk) |
diff --git a/drivers/gpu/drm/radeon/radeon_ring.c b/drivers/gpu/drm/radeon/radeon_ring.c index bbc9cd823334..c6776e48fdde 100644 --- a/drivers/gpu/drm/radeon/radeon_ring.c +++ b/drivers/gpu/drm/radeon/radeon_ring.c | |||
| @@ -248,7 +248,7 @@ void radeon_ib_pool_fini(struct radeon_device *rdev) | |||
| 248 | void radeon_ring_free_size(struct radeon_device *rdev) | 248 | void radeon_ring_free_size(struct radeon_device *rdev) |
| 249 | { | 249 | { |
| 250 | if (rdev->wb.enabled) | 250 | if (rdev->wb.enabled) |
| 251 | rdev->cp.rptr = rdev->wb.wb[RADEON_WB_CP_RPTR_OFFSET/4]; | 251 | rdev->cp.rptr = le32_to_cpu(rdev->wb.wb[RADEON_WB_CP_RPTR_OFFSET/4]); |
| 252 | else { | 252 | else { |
| 253 | if (rdev->family >= CHIP_R600) | 253 | if (rdev->family >= CHIP_R600) |
| 254 | rdev->cp.rptr = RREG32(R600_CP_RB_RPTR); | 254 | rdev->cp.rptr = RREG32(R600_CP_RB_RPTR); |
diff --git a/drivers/gpu/drm/radeon/rs600.c b/drivers/gpu/drm/radeon/rs600.c index 876cebc4b8ba..6e3b11e5abbe 100644 --- a/drivers/gpu/drm/radeon/rs600.c +++ b/drivers/gpu/drm/radeon/rs600.c | |||
| @@ -114,7 +114,7 @@ void rs600_pm_misc(struct radeon_device *rdev) | |||
| 114 | udelay(voltage->delay); | 114 | udelay(voltage->delay); |
| 115 | } | 115 | } |
| 116 | } else if (voltage->type == VOLTAGE_VDDC) | 116 | } else if (voltage->type == VOLTAGE_VDDC) |
| 117 | radeon_atom_set_voltage(rdev, voltage->vddc_id); | 117 | radeon_atom_set_voltage(rdev, voltage->vddc_id, SET_VOLTAGE_TYPE_ASIC_VDDC); |
| 118 | 118 | ||
| 119 | dyn_pwrmgt_sclk_length = RREG32_PLL(DYN_PWRMGT_SCLK_LENGTH); | 119 | dyn_pwrmgt_sclk_length = RREG32_PLL(DYN_PWRMGT_SCLK_LENGTH); |
| 120 | dyn_pwrmgt_sclk_length &= ~REDUCED_POWER_SCLK_HILEN(0xf); | 120 | dyn_pwrmgt_sclk_length &= ~REDUCED_POWER_SCLK_HILEN(0xf); |
diff --git a/drivers/gpu/drm/radeon/rv770.c b/drivers/gpu/drm/radeon/rv770.c index b974ac7df8df..ef8a5babe9f7 100644 --- a/drivers/gpu/drm/radeon/rv770.c +++ b/drivers/gpu/drm/radeon/rv770.c | |||
| @@ -106,7 +106,7 @@ void rv770_pm_misc(struct radeon_device *rdev) | |||
| 106 | 106 | ||
| 107 | if ((voltage->type == VOLTAGE_SW) && voltage->voltage) { | 107 | if ((voltage->type == VOLTAGE_SW) && voltage->voltage) { |
| 108 | if (voltage->voltage != rdev->pm.current_vddc) { | 108 | if (voltage->voltage != rdev->pm.current_vddc) { |
| 109 | radeon_atom_set_voltage(rdev, voltage->voltage); | 109 | radeon_atom_set_voltage(rdev, voltage->voltage, SET_VOLTAGE_TYPE_ASIC_VDDC); |
| 110 | rdev->pm.current_vddc = voltage->voltage; | 110 | rdev->pm.current_vddc = voltage->voltage; |
| 111 | DRM_DEBUG("Setting: v: %d\n", voltage->voltage); | 111 | DRM_DEBUG("Setting: v: %d\n", voltage->voltage); |
| 112 | } | 112 | } |
| @@ -1255,9 +1255,6 @@ int rv770_init(struct radeon_device *rdev) | |||
| 1255 | { | 1255 | { |
| 1256 | int r; | 1256 | int r; |
| 1257 | 1257 | ||
| 1258 | r = radeon_dummy_page_init(rdev); | ||
| 1259 | if (r) | ||
| 1260 | return r; | ||
| 1261 | /* This don't do much */ | 1258 | /* This don't do much */ |
| 1262 | r = radeon_gem_init(rdev); | 1259 | r = radeon_gem_init(rdev); |
| 1263 | if (r) | 1260 | if (r) |
| @@ -1372,7 +1369,6 @@ void rv770_fini(struct radeon_device *rdev) | |||
| 1372 | radeon_atombios_fini(rdev); | 1369 | radeon_atombios_fini(rdev); |
| 1373 | kfree(rdev->bios); | 1370 | kfree(rdev->bios); |
| 1374 | rdev->bios = NULL; | 1371 | rdev->bios = NULL; |
| 1375 | radeon_dummy_page_fini(rdev); | ||
| 1376 | } | 1372 | } |
| 1377 | 1373 | ||
| 1378 | static void rv770_pcie_gen2_enable(struct radeon_device *rdev) | 1374 | static void rv770_pcie_gen2_enable(struct radeon_device *rdev) |
diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc.c b/drivers/gpu/drm/ttm/ttm_page_alloc.c index 737a2a2e46a5..9d9d92945f8c 100644 --- a/drivers/gpu/drm/ttm/ttm_page_alloc.c +++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c | |||
| @@ -683,22 +683,14 @@ int ttm_get_pages(struct list_head *pages, int flags, | |||
| 683 | gfp_flags |= GFP_HIGHUSER; | 683 | gfp_flags |= GFP_HIGHUSER; |
| 684 | 684 | ||
| 685 | for (r = 0; r < count; ++r) { | 685 | for (r = 0; r < count; ++r) { |
| 686 | if ((flags & TTM_PAGE_FLAG_DMA32) && dma_address) { | 686 | p = alloc_page(gfp_flags); |
| 687 | void *addr; | ||
| 688 | addr = dma_alloc_coherent(NULL, PAGE_SIZE, | ||
| 689 | &dma_address[r], | ||
| 690 | gfp_flags); | ||
| 691 | if (addr == NULL) | ||
| 692 | return -ENOMEM; | ||
| 693 | p = virt_to_page(addr); | ||
| 694 | } else | ||
| 695 | p = alloc_page(gfp_flags); | ||
| 696 | if (!p) { | 687 | if (!p) { |
| 697 | 688 | ||
| 698 | printk(KERN_ERR TTM_PFX | 689 | printk(KERN_ERR TTM_PFX |
| 699 | "Unable to allocate page."); | 690 | "Unable to allocate page."); |
| 700 | return -ENOMEM; | 691 | return -ENOMEM; |
| 701 | } | 692 | } |
| 693 | |||
| 702 | list_add(&p->lru, pages); | 694 | list_add(&p->lru, pages); |
| 703 | } | 695 | } |
| 704 | return 0; | 696 | return 0; |
| @@ -746,24 +738,12 @@ void ttm_put_pages(struct list_head *pages, unsigned page_count, int flags, | |||
| 746 | unsigned long irq_flags; | 738 | unsigned long irq_flags; |
| 747 | struct ttm_page_pool *pool = ttm_get_pool(flags, cstate); | 739 | struct ttm_page_pool *pool = ttm_get_pool(flags, cstate); |
| 748 | struct page *p, *tmp; | 740 | struct page *p, *tmp; |
| 749 | unsigned r; | ||
| 750 | 741 | ||
| 751 | if (pool == NULL) { | 742 | if (pool == NULL) { |
| 752 | /* No pool for this memory type so free the pages */ | 743 | /* No pool for this memory type so free the pages */ |
| 753 | 744 | ||
| 754 | r = page_count-1; | ||
| 755 | list_for_each_entry_safe(p, tmp, pages, lru) { | 745 | list_for_each_entry_safe(p, tmp, pages, lru) { |
| 756 | if ((flags & TTM_PAGE_FLAG_DMA32) && dma_address) { | 746 | __free_page(p); |
| 757 | void *addr = page_address(p); | ||
| 758 | WARN_ON(!addr || !dma_address[r]); | ||
| 759 | if (addr) | ||
| 760 | dma_free_coherent(NULL, PAGE_SIZE, | ||
| 761 | addr, | ||
| 762 | dma_address[r]); | ||
| 763 | dma_address[r] = 0; | ||
| 764 | } else | ||
| 765 | __free_page(p); | ||
| 766 | r--; | ||
| 767 | } | 747 | } |
| 768 | /* Make the pages list empty */ | 748 | /* Make the pages list empty */ |
| 769 | INIT_LIST_HEAD(pages); | 749 | INIT_LIST_HEAD(pages); |
diff --git a/drivers/gpu/stub/Kconfig b/drivers/gpu/stub/Kconfig index 70e60a4bb678..419917955bf6 100644 --- a/drivers/gpu/stub/Kconfig +++ b/drivers/gpu/stub/Kconfig | |||
| @@ -5,6 +5,7 @@ config STUB_POULSBO | |||
| 5 | # Poulsbo stub depends on ACPI_VIDEO when ACPI is enabled | 5 | # Poulsbo stub depends on ACPI_VIDEO when ACPI is enabled |
| 6 | # but for select to work, need to select ACPI_VIDEO's dependencies, ick | 6 | # but for select to work, need to select ACPI_VIDEO's dependencies, ick |
| 7 | select BACKLIGHT_CLASS_DEVICE if ACPI | 7 | select BACKLIGHT_CLASS_DEVICE if ACPI |
| 8 | select VIDEO_OUTPUT_CONTROL if ACPI | ||
| 8 | select INPUT if ACPI | 9 | select INPUT if ACPI |
| 9 | select ACPI_VIDEO if ACPI | 10 | select ACPI_VIDEO if ACPI |
| 10 | select THERMAL if ACPI | 11 | select THERMAL if ACPI |
diff --git a/drivers/leds/leds-regulator.c b/drivers/leds/leds-regulator.c index 3790816643be..8497f56f8e46 100644 --- a/drivers/leds/leds-regulator.c +++ b/drivers/leds/leds-regulator.c | |||
| @@ -178,6 +178,10 @@ static int __devinit regulator_led_probe(struct platform_device *pdev) | |||
| 178 | led->cdev.flags |= LED_CORE_SUSPENDRESUME; | 178 | led->cdev.flags |= LED_CORE_SUSPENDRESUME; |
| 179 | led->vcc = vcc; | 179 | led->vcc = vcc; |
| 180 | 180 | ||
| 181 | /* to handle correctly an already enabled regulator */ | ||
| 182 | if (regulator_is_enabled(led->vcc)) | ||
| 183 | led->enabled = 1; | ||
| 184 | |||
| 181 | mutex_init(&led->mutex); | 185 | mutex_init(&led->mutex); |
| 182 | INIT_WORK(&led->work, led_work); | 186 | INIT_WORK(&led->work, led_work); |
| 183 | 187 | ||
diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c index d01574d98870..f4c8c844b913 100644 --- a/drivers/mfd/mfd-core.c +++ b/drivers/mfd/mfd-core.c | |||
| @@ -55,6 +55,19 @@ int mfd_cell_disable(struct platform_device *pdev) | |||
| 55 | } | 55 | } |
| 56 | EXPORT_SYMBOL(mfd_cell_disable); | 56 | EXPORT_SYMBOL(mfd_cell_disable); |
| 57 | 57 | ||
| 58 | static int mfd_platform_add_cell(struct platform_device *pdev, | ||
| 59 | const struct mfd_cell *cell) | ||
| 60 | { | ||
| 61 | if (!cell) | ||
| 62 | return 0; | ||
| 63 | |||
| 64 | pdev->mfd_cell = kmemdup(cell, sizeof(*cell), GFP_KERNEL); | ||
| 65 | if (!pdev->mfd_cell) | ||
| 66 | return -ENOMEM; | ||
| 67 | |||
| 68 | return 0; | ||
| 69 | } | ||
| 70 | |||
| 58 | static int mfd_add_device(struct device *parent, int id, | 71 | static int mfd_add_device(struct device *parent, int id, |
| 59 | const struct mfd_cell *cell, | 72 | const struct mfd_cell *cell, |
| 60 | struct resource *mem_base, | 73 | struct resource *mem_base, |
| @@ -75,7 +88,7 @@ static int mfd_add_device(struct device *parent, int id, | |||
| 75 | 88 | ||
| 76 | pdev->dev.parent = parent; | 89 | pdev->dev.parent = parent; |
| 77 | 90 | ||
| 78 | ret = platform_device_add_data(pdev, cell, sizeof(*cell)); | 91 | ret = mfd_platform_add_cell(pdev, cell); |
| 79 | if (ret) | 92 | if (ret) |
| 80 | goto fail_res; | 93 | goto fail_res; |
| 81 | 94 | ||
| @@ -123,7 +136,6 @@ static int mfd_add_device(struct device *parent, int id, | |||
| 123 | 136 | ||
| 124 | return 0; | 137 | return 0; |
| 125 | 138 | ||
| 126 | /* platform_device_del(pdev); */ | ||
| 127 | fail_res: | 139 | fail_res: |
| 128 | kfree(res); | 140 | kfree(res); |
| 129 | fail_device: | 141 | fail_device: |
diff --git a/drivers/misc/sgi-gru/grufile.c b/drivers/misc/sgi-gru/grufile.c index 20e4e9395b61..ecafa4ba238b 100644 --- a/drivers/misc/sgi-gru/grufile.c +++ b/drivers/misc/sgi-gru/grufile.c | |||
| @@ -348,15 +348,15 @@ static unsigned long gru_chiplet_cpu_to_mmr(int chiplet, int cpu, int *corep) | |||
| 348 | 348 | ||
| 349 | static int gru_irq_count[GRU_CHIPLETS_PER_BLADE]; | 349 | static int gru_irq_count[GRU_CHIPLETS_PER_BLADE]; |
| 350 | 350 | ||
| 351 | static void gru_noop(unsigned int irq) | 351 | static void gru_noop(struct irq_data *d) |
| 352 | { | 352 | { |
| 353 | } | 353 | } |
| 354 | 354 | ||
| 355 | static struct irq_chip gru_chip[GRU_CHIPLETS_PER_BLADE] = { | 355 | static struct irq_chip gru_chip[GRU_CHIPLETS_PER_BLADE] = { |
| 356 | [0 ... GRU_CHIPLETS_PER_BLADE - 1] { | 356 | [0 ... GRU_CHIPLETS_PER_BLADE - 1] { |
| 357 | .mask = gru_noop, | 357 | .irq_mask = gru_noop, |
| 358 | .unmask = gru_noop, | 358 | .irq_unmask = gru_noop, |
| 359 | .ack = gru_noop | 359 | .irq_ack = gru_noop |
| 360 | } | 360 | } |
| 361 | }; | 361 | }; |
| 362 | 362 | ||
diff --git a/drivers/mtd/mtdswap.c b/drivers/mtd/mtdswap.c index 237913c5c92c..fed215c4cfa1 100644 --- a/drivers/mtd/mtdswap.c +++ b/drivers/mtd/mtdswap.c | |||
| @@ -1452,7 +1452,7 @@ static void mtdswap_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd) | |||
| 1452 | oinfo = mtd->ecclayout; | 1452 | oinfo = mtd->ecclayout; |
| 1453 | if (!mtd->oobsize || !oinfo || oinfo->oobavail < MTDSWAP_OOBSIZE) { | 1453 | if (!mtd->oobsize || !oinfo || oinfo->oobavail < MTDSWAP_OOBSIZE) { |
| 1454 | printk(KERN_ERR "%s: Not enough free bytes in OOB, " | 1454 | printk(KERN_ERR "%s: Not enough free bytes in OOB, " |
| 1455 | "%d available, %lu needed.\n", | 1455 | "%d available, %zu needed.\n", |
| 1456 | MTDSWAP_PREFIX, oinfo->oobavail, MTDSWAP_OOBSIZE); | 1456 | MTDSWAP_PREFIX, oinfo->oobavail, MTDSWAP_OOBSIZE); |
| 1457 | return; | 1457 | return; |
| 1458 | } | 1458 | } |
diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c index 6fae04b3fc6d..950646aa4c4b 100644 --- a/drivers/mtd/nand/atmel_nand.c +++ b/drivers/mtd/nand/atmel_nand.c | |||
| @@ -209,22 +209,8 @@ static int atmel_nand_dma_op(struct mtd_info *mtd, void *buf, int len, | |||
| 209 | int err = -EIO; | 209 | int err = -EIO; |
| 210 | enum dma_data_direction dir = is_read ? DMA_FROM_DEVICE : DMA_TO_DEVICE; | 210 | enum dma_data_direction dir = is_read ? DMA_FROM_DEVICE : DMA_TO_DEVICE; |
| 211 | 211 | ||
| 212 | if (buf >= high_memory) { | 212 | if (buf >= high_memory) |
| 213 | struct page *pg; | 213 | goto err_buf; |
| 214 | |||
| 215 | if (((size_t)buf & PAGE_MASK) != | ||
| 216 | ((size_t)(buf + len - 1) & PAGE_MASK)) { | ||
| 217 | dev_warn(host->dev, "Buffer not fit in one page\n"); | ||
| 218 | goto err_buf; | ||
| 219 | } | ||
| 220 | |||
| 221 | pg = vmalloc_to_page(buf); | ||
| 222 | if (pg == 0) { | ||
| 223 | dev_err(host->dev, "Failed to vmalloc_to_page\n"); | ||
| 224 | goto err_buf; | ||
| 225 | } | ||
| 226 | p = page_address(pg) + ((size_t)buf & ~PAGE_MASK); | ||
| 227 | } | ||
| 228 | 214 | ||
| 229 | dma_dev = host->dma_chan->device; | 215 | dma_dev = host->dma_chan->device; |
| 230 | 216 | ||
| @@ -280,7 +266,8 @@ static void atmel_read_buf(struct mtd_info *mtd, u8 *buf, int len) | |||
| 280 | struct nand_chip *chip = mtd->priv; | 266 | struct nand_chip *chip = mtd->priv; |
| 281 | struct atmel_nand_host *host = chip->priv; | 267 | struct atmel_nand_host *host = chip->priv; |
| 282 | 268 | ||
| 283 | if (use_dma && len >= mtd->oobsize) | 269 | if (use_dma && len > mtd->oobsize) |
| 270 | /* only use DMA for bigger than oob size: better performances */ | ||
| 284 | if (atmel_nand_dma_op(mtd, buf, len, 1) == 0) | 271 | if (atmel_nand_dma_op(mtd, buf, len, 1) == 0) |
| 285 | return; | 272 | return; |
| 286 | 273 | ||
| @@ -295,7 +282,8 @@ static void atmel_write_buf(struct mtd_info *mtd, const u8 *buf, int len) | |||
| 295 | struct nand_chip *chip = mtd->priv; | 282 | struct nand_chip *chip = mtd->priv; |
| 296 | struct atmel_nand_host *host = chip->priv; | 283 | struct atmel_nand_host *host = chip->priv; |
| 297 | 284 | ||
| 298 | if (use_dma && len >= mtd->oobsize) | 285 | if (use_dma && len > mtd->oobsize) |
| 286 | /* only use DMA for bigger than oob size: better performances */ | ||
| 299 | if (atmel_nand_dma_op(mtd, (void *)buf, len, 0) == 0) | 287 | if (atmel_nand_dma_op(mtd, (void *)buf, len, 0) == 0) |
| 300 | return; | 288 | return; |
| 301 | 289 | ||
| @@ -599,7 +587,10 @@ static int __init atmel_nand_probe(struct platform_device *pdev) | |||
| 599 | nand_chip->options |= NAND_USE_FLASH_BBT; | 587 | nand_chip->options |= NAND_USE_FLASH_BBT; |
| 600 | } | 588 | } |
| 601 | 589 | ||
| 602 | if (cpu_has_dma() && use_dma) { | 590 | if (!cpu_has_dma()) |
| 591 | use_dma = 0; | ||
| 592 | |||
| 593 | if (use_dma) { | ||
| 603 | dma_cap_mask_t mask; | 594 | dma_cap_mask_t mask; |
| 604 | 595 | ||
| 605 | dma_cap_zero(mask); | 596 | dma_cap_zero(mask); |
| @@ -611,7 +602,8 @@ static int __init atmel_nand_probe(struct platform_device *pdev) | |||
| 611 | } | 602 | } |
| 612 | } | 603 | } |
| 613 | if (use_dma) | 604 | if (use_dma) |
| 614 | dev_info(host->dev, "Using DMA for NAND access.\n"); | 605 | dev_info(host->dev, "Using %s for DMA transfers.\n", |
| 606 | dma_chan_name(host->dma_chan)); | ||
| 615 | else | 607 | else |
| 616 | dev_info(host->dev, "No DMA support for NAND access.\n"); | 608 | dev_info(host->dev, "No DMA support for NAND access.\n"); |
| 617 | 609 | ||
diff --git a/drivers/net/benet/be.h b/drivers/net/benet/be.h index f803c58b941d..66823eded7a3 100644 --- a/drivers/net/benet/be.h +++ b/drivers/net/benet/be.h | |||
| @@ -154,7 +154,7 @@ struct be_eq_obj { | |||
| 154 | u16 min_eqd; /* in usecs */ | 154 | u16 min_eqd; /* in usecs */ |
| 155 | u16 max_eqd; /* in usecs */ | 155 | u16 max_eqd; /* in usecs */ |
| 156 | u16 cur_eqd; /* in usecs */ | 156 | u16 cur_eqd; /* in usecs */ |
| 157 | u8 msix_vec_idx; | 157 | u8 eq_idx; |
| 158 | 158 | ||
| 159 | struct napi_struct napi; | 159 | struct napi_struct napi; |
| 160 | }; | 160 | }; |
| @@ -291,7 +291,7 @@ struct be_adapter { | |||
| 291 | u32 num_rx_qs; | 291 | u32 num_rx_qs; |
| 292 | u32 big_page_size; /* Compounded page size shared by rx wrbs */ | 292 | u32 big_page_size; /* Compounded page size shared by rx wrbs */ |
| 293 | 293 | ||
| 294 | u8 msix_vec_next_idx; | 294 | u8 eq_next_idx; |
| 295 | struct be_drv_stats drv_stats; | 295 | struct be_drv_stats drv_stats; |
| 296 | 296 | ||
| 297 | struct vlan_group *vlan_grp; | 297 | struct vlan_group *vlan_grp; |
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c index 9a54c8b24ff9..7cb5a114c733 100644 --- a/drivers/net/benet/be_main.c +++ b/drivers/net/benet/be_main.c | |||
| @@ -1497,7 +1497,7 @@ static int be_tx_queues_create(struct be_adapter *adapter) | |||
| 1497 | if (be_cmd_eq_create(adapter, eq, adapter->tx_eq.cur_eqd)) | 1497 | if (be_cmd_eq_create(adapter, eq, adapter->tx_eq.cur_eqd)) |
| 1498 | goto tx_eq_free; | 1498 | goto tx_eq_free; |
| 1499 | 1499 | ||
| 1500 | adapter->tx_eq.msix_vec_idx = adapter->msix_vec_next_idx++; | 1500 | adapter->tx_eq.eq_idx = adapter->eq_next_idx++; |
| 1501 | 1501 | ||
| 1502 | 1502 | ||
| 1503 | /* Alloc TX eth compl queue */ | 1503 | /* Alloc TX eth compl queue */ |
| @@ -1590,7 +1590,7 @@ static int be_rx_queues_create(struct be_adapter *adapter) | |||
| 1590 | if (rc) | 1590 | if (rc) |
| 1591 | goto err; | 1591 | goto err; |
| 1592 | 1592 | ||
| 1593 | rxo->rx_eq.msix_vec_idx = adapter->msix_vec_next_idx++; | 1593 | rxo->rx_eq.eq_idx = adapter->eq_next_idx++; |
| 1594 | 1594 | ||
| 1595 | /* CQ */ | 1595 | /* CQ */ |
| 1596 | cq = &rxo->cq; | 1596 | cq = &rxo->cq; |
| @@ -1666,11 +1666,11 @@ static irqreturn_t be_intx(int irq, void *dev) | |||
| 1666 | if (!isr) | 1666 | if (!isr) |
| 1667 | return IRQ_NONE; | 1667 | return IRQ_NONE; |
| 1668 | 1668 | ||
| 1669 | if ((1 << adapter->tx_eq.msix_vec_idx & isr)) | 1669 | if ((1 << adapter->tx_eq.eq_idx & isr)) |
| 1670 | event_handle(adapter, &adapter->tx_eq); | 1670 | event_handle(adapter, &adapter->tx_eq); |
| 1671 | 1671 | ||
| 1672 | for_all_rx_queues(adapter, rxo, i) { | 1672 | for_all_rx_queues(adapter, rxo, i) { |
| 1673 | if ((1 << rxo->rx_eq.msix_vec_idx & isr)) | 1673 | if ((1 << rxo->rx_eq.eq_idx & isr)) |
| 1674 | event_handle(adapter, &rxo->rx_eq); | 1674 | event_handle(adapter, &rxo->rx_eq); |
| 1675 | } | 1675 | } |
| 1676 | } | 1676 | } |
| @@ -1951,7 +1951,7 @@ static void be_sriov_disable(struct be_adapter *adapter) | |||
| 1951 | static inline int be_msix_vec_get(struct be_adapter *adapter, | 1951 | static inline int be_msix_vec_get(struct be_adapter *adapter, |
| 1952 | struct be_eq_obj *eq_obj) | 1952 | struct be_eq_obj *eq_obj) |
| 1953 | { | 1953 | { |
| 1954 | return adapter->msix_entries[eq_obj->msix_vec_idx].vector; | 1954 | return adapter->msix_entries[eq_obj->eq_idx].vector; |
| 1955 | } | 1955 | } |
| 1956 | 1956 | ||
| 1957 | static int be_request_irq(struct be_adapter *adapter, | 1957 | static int be_request_irq(struct be_adapter *adapter, |
| @@ -2345,6 +2345,7 @@ static int be_clear(struct be_adapter *adapter) | |||
| 2345 | be_mcc_queues_destroy(adapter); | 2345 | be_mcc_queues_destroy(adapter); |
| 2346 | be_rx_queues_destroy(adapter); | 2346 | be_rx_queues_destroy(adapter); |
| 2347 | be_tx_queues_destroy(adapter); | 2347 | be_tx_queues_destroy(adapter); |
| 2348 | adapter->eq_next_idx = 0; | ||
| 2348 | 2349 | ||
| 2349 | if (be_physfn(adapter) && adapter->sriov_enabled) | 2350 | if (be_physfn(adapter) && adapter->sriov_enabled) |
| 2350 | for (vf = 0; vf < num_vfs; vf++) | 2351 | for (vf = 0; vf < num_vfs; vf++) |
| @@ -3141,12 +3142,14 @@ static int be_resume(struct pci_dev *pdev) | |||
| 3141 | static void be_shutdown(struct pci_dev *pdev) | 3142 | static void be_shutdown(struct pci_dev *pdev) |
| 3142 | { | 3143 | { |
| 3143 | struct be_adapter *adapter = pci_get_drvdata(pdev); | 3144 | struct be_adapter *adapter = pci_get_drvdata(pdev); |
| 3144 | struct net_device *netdev = adapter->netdev; | ||
| 3145 | 3145 | ||
| 3146 | if (netif_running(netdev)) | 3146 | if (!adapter) |
| 3147 | return; | ||
| 3148 | |||
| 3149 | if (netif_running(adapter->netdev)) | ||
| 3147 | cancel_delayed_work_sync(&adapter->work); | 3150 | cancel_delayed_work_sync(&adapter->work); |
| 3148 | 3151 | ||
| 3149 | netif_device_detach(netdev); | 3152 | netif_device_detach(adapter->netdev); |
| 3150 | 3153 | ||
| 3151 | be_cmd_reset_function(adapter); | 3154 | be_cmd_reset_function(adapter); |
| 3152 | 3155 | ||
diff --git a/drivers/net/bna/bfa_ioc.c b/drivers/net/bna/bfa_ioc.c index 34933cb9569f..e3de0b8625cd 100644 --- a/drivers/net/bna/bfa_ioc.c +++ b/drivers/net/bna/bfa_ioc.c | |||
| @@ -2219,13 +2219,9 @@ bfa_nw_ioc_get_mac(struct bfa_ioc *ioc) | |||
| 2219 | static void | 2219 | static void |
| 2220 | bfa_ioc_recover(struct bfa_ioc *ioc) | 2220 | bfa_ioc_recover(struct bfa_ioc *ioc) |
| 2221 | { | 2221 | { |
| 2222 | u16 bdf; | 2222 | pr_crit("Heart Beat of IOC has failed\n"); |
| 2223 | 2223 | bfa_ioc_stats(ioc, ioc_hbfails); | |
| 2224 | bdf = (ioc->pcidev.pci_slot << 8 | ioc->pcidev.pci_func << 3 | | 2224 | bfa_fsm_send_event(ioc, IOC_E_HBFAIL); |
| 2225 | ioc->pcidev.device_id); | ||
| 2226 | |||
| 2227 | pr_crit("Firmware heartbeat failure at %d", bdf); | ||
| 2228 | BUG_ON(1); | ||
| 2229 | } | 2225 | } |
| 2230 | 2226 | ||
| 2231 | static void | 2227 | static void |
diff --git a/drivers/net/can/mcp251x.c b/drivers/net/can/mcp251x.c index 7513c4523ac4..330140ee266d 100644 --- a/drivers/net/can/mcp251x.c +++ b/drivers/net/can/mcp251x.c | |||
| @@ -931,7 +931,8 @@ static int mcp251x_open(struct net_device *net) | |||
| 931 | priv->tx_len = 0; | 931 | priv->tx_len = 0; |
| 932 | 932 | ||
| 933 | ret = request_threaded_irq(spi->irq, NULL, mcp251x_can_ist, | 933 | ret = request_threaded_irq(spi->irq, NULL, mcp251x_can_ist, |
| 934 | IRQF_TRIGGER_FALLING, DEVICE_NAME, priv); | 934 | pdata->irq_flags ? pdata->irq_flags : IRQF_TRIGGER_FALLING, |
| 935 | DEVICE_NAME, priv); | ||
| 935 | if (ret) { | 936 | if (ret) { |
| 936 | dev_err(&spi->dev, "failed to acquire irq %d\n", spi->irq); | 937 | dev_err(&spi->dev, "failed to acquire irq %d\n", spi->irq); |
| 937 | if (pdata->transceiver_enable) | 938 | if (pdata->transceiver_enable) |
diff --git a/drivers/net/mlx4/en_rx.c b/drivers/net/mlx4/en_rx.c index cfd50bc49169..62dd21b06df4 100644 --- a/drivers/net/mlx4/en_rx.c +++ b/drivers/net/mlx4/en_rx.c | |||
| @@ -345,6 +345,8 @@ int mlx4_en_activate_rx_rings(struct mlx4_en_priv *priv) | |||
| 345 | err = mlx4_en_init_allocator(priv, ring); | 345 | err = mlx4_en_init_allocator(priv, ring); |
| 346 | if (err) { | 346 | if (err) { |
| 347 | en_err(priv, "Failed initializing ring allocator\n"); | 347 | en_err(priv, "Failed initializing ring allocator\n"); |
| 348 | if (ring->stride <= TXBB_SIZE) | ||
| 349 | ring->buf -= TXBB_SIZE; | ||
| 348 | ring_ind--; | 350 | ring_ind--; |
| 349 | goto err_allocator; | 351 | goto err_allocator; |
| 350 | } | 352 | } |
| @@ -369,6 +371,8 @@ err_buffers: | |||
| 369 | ring_ind = priv->rx_ring_num - 1; | 371 | ring_ind = priv->rx_ring_num - 1; |
| 370 | err_allocator: | 372 | err_allocator: |
| 371 | while (ring_ind >= 0) { | 373 | while (ring_ind >= 0) { |
| 374 | if (priv->rx_ring[ring_ind].stride <= TXBB_SIZE) | ||
| 375 | priv->rx_ring[ring_ind].buf -= TXBB_SIZE; | ||
| 372 | mlx4_en_destroy_allocator(priv, &priv->rx_ring[ring_ind]); | 376 | mlx4_en_destroy_allocator(priv, &priv->rx_ring[ring_ind]); |
| 373 | ring_ind--; | 377 | ring_ind--; |
| 374 | } | 378 | } |
diff --git a/drivers/net/mlx4/main.c b/drivers/net/mlx4/main.c index 62fa7eec5f0c..3814fc9b1145 100644 --- a/drivers/net/mlx4/main.c +++ b/drivers/net/mlx4/main.c | |||
| @@ -944,6 +944,10 @@ static int mlx4_setup_hca(struct mlx4_dev *dev) | |||
| 944 | } | 944 | } |
| 945 | 945 | ||
| 946 | for (port = 1; port <= dev->caps.num_ports; port++) { | 946 | for (port = 1; port <= dev->caps.num_ports; port++) { |
| 947 | enum mlx4_port_type port_type = 0; | ||
| 948 | mlx4_SENSE_PORT(dev, port, &port_type); | ||
| 949 | if (port_type) | ||
| 950 | dev->caps.port_type[port] = port_type; | ||
| 947 | ib_port_default_caps = 0; | 951 | ib_port_default_caps = 0; |
| 948 | err = mlx4_get_port_ib_caps(dev, port, &ib_port_default_caps); | 952 | err = mlx4_get_port_ib_caps(dev, port, &ib_port_default_caps); |
| 949 | if (err) | 953 | if (err) |
| @@ -958,6 +962,7 @@ static int mlx4_setup_hca(struct mlx4_dev *dev) | |||
| 958 | goto err_mcg_table_free; | 962 | goto err_mcg_table_free; |
| 959 | } | 963 | } |
| 960 | } | 964 | } |
| 965 | mlx4_set_port_mask(dev); | ||
| 961 | 966 | ||
| 962 | return 0; | 967 | return 0; |
| 963 | 968 | ||
diff --git a/drivers/net/mlx4/mlx4.h b/drivers/net/mlx4/mlx4.h index c1e0e5f1bcdb..dd7d745fbab4 100644 --- a/drivers/net/mlx4/mlx4.h +++ b/drivers/net/mlx4/mlx4.h | |||
| @@ -431,6 +431,8 @@ void mlx4_srq_event(struct mlx4_dev *dev, u32 srqn, int event_type); | |||
| 431 | 431 | ||
| 432 | void mlx4_handle_catas_err(struct mlx4_dev *dev); | 432 | void mlx4_handle_catas_err(struct mlx4_dev *dev); |
| 433 | 433 | ||
| 434 | int mlx4_SENSE_PORT(struct mlx4_dev *dev, int port, | ||
| 435 | enum mlx4_port_type *type); | ||
| 434 | void mlx4_do_sense_ports(struct mlx4_dev *dev, | 436 | void mlx4_do_sense_ports(struct mlx4_dev *dev, |
| 435 | enum mlx4_port_type *stype, | 437 | enum mlx4_port_type *stype, |
| 436 | enum mlx4_port_type *defaults); | 438 | enum mlx4_port_type *defaults); |
diff --git a/drivers/net/mlx4/sense.c b/drivers/net/mlx4/sense.c index 015fbe785c13..e2337a7411d9 100644 --- a/drivers/net/mlx4/sense.c +++ b/drivers/net/mlx4/sense.c | |||
| @@ -38,8 +38,8 @@ | |||
| 38 | 38 | ||
| 39 | #include "mlx4.h" | 39 | #include "mlx4.h" |
| 40 | 40 | ||
| 41 | static int mlx4_SENSE_PORT(struct mlx4_dev *dev, int port, | 41 | int mlx4_SENSE_PORT(struct mlx4_dev *dev, int port, |
| 42 | enum mlx4_port_type *type) | 42 | enum mlx4_port_type *type) |
| 43 | { | 43 | { |
| 44 | u64 out_param; | 44 | u64 out_param; |
| 45 | int err = 0; | 45 | int err = 0; |
diff --git a/drivers/net/pppoe.c b/drivers/net/pppoe.c index 693aaef4e3ce..718879b35b7d 100644 --- a/drivers/net/pppoe.c +++ b/drivers/net/pppoe.c | |||
| @@ -317,7 +317,7 @@ static void pppoe_flush_dev(struct net_device *dev) | |||
| 317 | lock_sock(sk); | 317 | lock_sock(sk); |
| 318 | 318 | ||
| 319 | if (po->pppoe_dev == dev && | 319 | if (po->pppoe_dev == dev && |
| 320 | sk->sk_state & (PPPOX_CONNECTED | PPPOX_BOUND)) { | 320 | sk->sk_state & (PPPOX_CONNECTED | PPPOX_BOUND | PPPOX_ZOMBIE)) { |
| 321 | pppox_unbind_sock(sk); | 321 | pppox_unbind_sock(sk); |
| 322 | sk->sk_state = PPPOX_ZOMBIE; | 322 | sk->sk_state = PPPOX_ZOMBIE; |
| 323 | sk->sk_state_change(sk); | 323 | sk->sk_state_change(sk); |
diff --git a/drivers/net/smsc911x.c b/drivers/net/smsc911x.c index c498b720b532..4b42ecc63dcf 100644 --- a/drivers/net/smsc911x.c +++ b/drivers/net/smsc911x.c | |||
| @@ -1818,6 +1818,7 @@ static int __devinit smsc911x_init(struct net_device *dev) | |||
| 1818 | SMSC_TRACE(PROBE, "PHY will be autodetected."); | 1818 | SMSC_TRACE(PROBE, "PHY will be autodetected."); |
| 1819 | 1819 | ||
| 1820 | spin_lock_init(&pdata->dev_lock); | 1820 | spin_lock_init(&pdata->dev_lock); |
| 1821 | spin_lock_init(&pdata->mac_lock); | ||
| 1821 | 1822 | ||
| 1822 | if (pdata->ioaddr == 0) { | 1823 | if (pdata->ioaddr == 0) { |
| 1823 | SMSC_WARNING(PROBE, "pdata->ioaddr: 0x00000000"); | 1824 | SMSC_WARNING(PROBE, "pdata->ioaddr: 0x00000000"); |
| @@ -1895,8 +1896,11 @@ static int __devinit smsc911x_init(struct net_device *dev) | |||
| 1895 | /* workaround for platforms without an eeprom, where the mac address | 1896 | /* workaround for platforms without an eeprom, where the mac address |
| 1896 | * is stored elsewhere and set by the bootloader. This saves the | 1897 | * is stored elsewhere and set by the bootloader. This saves the |
| 1897 | * mac address before resetting the device */ | 1898 | * mac address before resetting the device */ |
| 1898 | if (pdata->config.flags & SMSC911X_SAVE_MAC_ADDRESS) | 1899 | if (pdata->config.flags & SMSC911X_SAVE_MAC_ADDRESS) { |
| 1900 | spin_lock_irq(&pdata->mac_lock); | ||
| 1899 | smsc911x_read_mac_address(dev); | 1901 | smsc911x_read_mac_address(dev); |
| 1902 | spin_unlock_irq(&pdata->mac_lock); | ||
| 1903 | } | ||
| 1900 | 1904 | ||
| 1901 | /* Reset the LAN911x */ | 1905 | /* Reset the LAN911x */ |
| 1902 | if (smsc911x_soft_reset(pdata)) | 1906 | if (smsc911x_soft_reset(pdata)) |
| @@ -2059,8 +2063,6 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev) | |||
| 2059 | SMSC_TRACE(PROBE, "Network interface: \"%s\"", dev->name); | 2063 | SMSC_TRACE(PROBE, "Network interface: \"%s\"", dev->name); |
| 2060 | } | 2064 | } |
| 2061 | 2065 | ||
| 2062 | spin_lock_init(&pdata->mac_lock); | ||
| 2063 | |||
| 2064 | retval = smsc911x_mii_init(pdev, dev); | 2066 | retval = smsc911x_mii_init(pdev, dev); |
| 2065 | if (retval) { | 2067 | if (retval) { |
| 2066 | SMSC_WARNING(PROBE, | 2068 | SMSC_WARNING(PROBE, |
diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c index 727874d9deb6..47a6c870b51f 100644 --- a/drivers/net/usb/smsc95xx.c +++ b/drivers/net/usb/smsc95xx.c | |||
| @@ -1313,6 +1313,21 @@ static const struct usb_device_id products[] = { | |||
| 1313 | USB_DEVICE(0x0424, 0x9909), | 1313 | USB_DEVICE(0x0424, 0x9909), |
| 1314 | .driver_info = (unsigned long) &smsc95xx_info, | 1314 | .driver_info = (unsigned long) &smsc95xx_info, |
| 1315 | }, | 1315 | }, |
| 1316 | { | ||
| 1317 | /* SMSC LAN9530 USB Ethernet Device */ | ||
| 1318 | USB_DEVICE(0x0424, 0x9530), | ||
| 1319 | .driver_info = (unsigned long) &smsc95xx_info, | ||
| 1320 | }, | ||
| 1321 | { | ||
| 1322 | /* SMSC LAN9730 USB Ethernet Device */ | ||
| 1323 | USB_DEVICE(0x0424, 0x9730), | ||
| 1324 | .driver_info = (unsigned long) &smsc95xx_info, | ||
| 1325 | }, | ||
| 1326 | { | ||
| 1327 | /* SMSC LAN89530 USB Ethernet Device */ | ||
| 1328 | USB_DEVICE(0x0424, 0x9E08), | ||
| 1329 | .driver_info = (unsigned long) &smsc95xx_info, | ||
| 1330 | }, | ||
| 1316 | { }, /* END */ | 1331 | { }, /* END */ |
| 1317 | }; | 1332 | }; |
| 1318 | MODULE_DEVICE_TABLE(usb, products); | 1333 | MODULE_DEVICE_TABLE(usb, products); |
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c index 338b07502f1a..1ec9bcd6b281 100644 --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c | |||
| @@ -2546,6 +2546,7 @@ static struct { | |||
| 2546 | { AR_SREV_VERSION_9287, "9287" }, | 2546 | { AR_SREV_VERSION_9287, "9287" }, |
| 2547 | { AR_SREV_VERSION_9271, "9271" }, | 2547 | { AR_SREV_VERSION_9271, "9271" }, |
| 2548 | { AR_SREV_VERSION_9300, "9300" }, | 2548 | { AR_SREV_VERSION_9300, "9300" }, |
| 2549 | { AR_SREV_VERSION_9485, "9485" }, | ||
| 2549 | }; | 2550 | }; |
| 2550 | 2551 | ||
| 2551 | /* For devices with external radios */ | 2552 | /* For devices with external radios */ |
diff --git a/drivers/net/wireless/b43/dma.c b/drivers/net/wireless/b43/dma.c index 3d5566e7af0a..ff0f5ba14b2c 100644 --- a/drivers/net/wireless/b43/dma.c +++ b/drivers/net/wireless/b43/dma.c | |||
| @@ -1536,7 +1536,7 @@ static void dma_rx(struct b43_dmaring *ring, int *slot) | |||
| 1536 | dmaaddr = meta->dmaaddr; | 1536 | dmaaddr = meta->dmaaddr; |
| 1537 | goto drop_recycle_buffer; | 1537 | goto drop_recycle_buffer; |
| 1538 | } | 1538 | } |
| 1539 | if (unlikely(len > ring->rx_buffersize)) { | 1539 | if (unlikely(len + ring->frameoffset > ring->rx_buffersize)) { |
| 1540 | /* The data did not fit into one descriptor buffer | 1540 | /* The data did not fit into one descriptor buffer |
| 1541 | * and is split over multiple buffers. | 1541 | * and is split over multiple buffers. |
| 1542 | * This should never happen, as we try to allocate buffers | 1542 | * This should never happen, as we try to allocate buffers |
diff --git a/drivers/net/wireless/b43/dma.h b/drivers/net/wireless/b43/dma.h index a01c2100f166..e8a80a1251bf 100644 --- a/drivers/net/wireless/b43/dma.h +++ b/drivers/net/wireless/b43/dma.h | |||
| @@ -163,7 +163,7 @@ struct b43_dmadesc_generic { | |||
| 163 | /* DMA engine tuning knobs */ | 163 | /* DMA engine tuning knobs */ |
| 164 | #define B43_TXRING_SLOTS 256 | 164 | #define B43_TXRING_SLOTS 256 |
| 165 | #define B43_RXRING_SLOTS 64 | 165 | #define B43_RXRING_SLOTS 64 |
| 166 | #define B43_DMA0_RX_BUFFERSIZE IEEE80211_MAX_FRAME_LEN | 166 | #define B43_DMA0_RX_BUFFERSIZE (B43_DMA0_RX_FRAMEOFFSET + IEEE80211_MAX_FRAME_LEN) |
| 167 | 167 | ||
| 168 | /* Pointer poison */ | 168 | /* Pointer poison */ |
| 169 | #define B43_DMA_PTR_POISON ((void *)ERR_PTR(-ENOMEM)) | 169 | #define B43_DMA_PTR_POISON ((void *)ERR_PTR(-ENOMEM)) |
diff --git a/drivers/net/wireless/iwlwifi/iwl-eeprom.h b/drivers/net/wireless/iwlwifi/iwl-eeprom.h index 98aa8af01192..20b66469d68f 100644 --- a/drivers/net/wireless/iwlwifi/iwl-eeprom.h +++ b/drivers/net/wireless/iwlwifi/iwl-eeprom.h | |||
| @@ -241,7 +241,7 @@ struct iwl_eeprom_enhanced_txpwr { | |||
| 241 | 241 | ||
| 242 | /* 6x00 Specific */ | 242 | /* 6x00 Specific */ |
| 243 | #define EEPROM_6000_TX_POWER_VERSION (4) | 243 | #define EEPROM_6000_TX_POWER_VERSION (4) |
| 244 | #define EEPROM_6000_EEPROM_VERSION (0x434) | 244 | #define EEPROM_6000_EEPROM_VERSION (0x423) |
| 245 | 245 | ||
| 246 | /* 6x50 Specific */ | 246 | /* 6x50 Specific */ |
| 247 | #define EEPROM_6050_TX_POWER_VERSION (4) | 247 | #define EEPROM_6050_TX_POWER_VERSION (4) |
diff --git a/drivers/net/wireless/p54/p54usb.c b/drivers/net/wireless/p54/p54usb.c index 9b344a921e74..e18358725b69 100644 --- a/drivers/net/wireless/p54/p54usb.c +++ b/drivers/net/wireless/p54/p54usb.c | |||
| @@ -56,6 +56,7 @@ static struct usb_device_id p54u_table[] __devinitdata = { | |||
| 56 | {USB_DEVICE(0x0846, 0x4210)}, /* Netgear WG121 the second ? */ | 56 | {USB_DEVICE(0x0846, 0x4210)}, /* Netgear WG121 the second ? */ |
| 57 | {USB_DEVICE(0x0846, 0x4220)}, /* Netgear WG111 */ | 57 | {USB_DEVICE(0x0846, 0x4220)}, /* Netgear WG111 */ |
| 58 | {USB_DEVICE(0x09aa, 0x1000)}, /* Spinnaker Proto board */ | 58 | {USB_DEVICE(0x09aa, 0x1000)}, /* Spinnaker Proto board */ |
| 59 | {USB_DEVICE(0x0bf8, 0x1007)}, /* Fujitsu E-5400 USB */ | ||
| 59 | {USB_DEVICE(0x0cde, 0x0006)}, /* Medion 40900, Roper Europe */ | 60 | {USB_DEVICE(0x0cde, 0x0006)}, /* Medion 40900, Roper Europe */ |
| 60 | {USB_DEVICE(0x0db0, 0x6826)}, /* MSI UB54G (MS-6826) */ | 61 | {USB_DEVICE(0x0db0, 0x6826)}, /* MSI UB54G (MS-6826) */ |
| 61 | {USB_DEVICE(0x107b, 0x55f2)}, /* Gateway WGU-210 (Gemtek) */ | 62 | {USB_DEVICE(0x107b, 0x55f2)}, /* Gateway WGU-210 (Gemtek) */ |
| @@ -68,6 +69,7 @@ static struct usb_device_id p54u_table[] __devinitdata = { | |||
| 68 | {USB_DEVICE(0x1915, 0x2235)}, /* Linksys WUSB54G Portable OEM */ | 69 | {USB_DEVICE(0x1915, 0x2235)}, /* Linksys WUSB54G Portable OEM */ |
| 69 | {USB_DEVICE(0x2001, 0x3701)}, /* DLink DWL-G120 Spinnaker */ | 70 | {USB_DEVICE(0x2001, 0x3701)}, /* DLink DWL-G120 Spinnaker */ |
| 70 | {USB_DEVICE(0x2001, 0x3703)}, /* DLink DWL-G122 */ | 71 | {USB_DEVICE(0x2001, 0x3703)}, /* DLink DWL-G122 */ |
| 72 | {USB_DEVICE(0x2001, 0x3762)}, /* Conceptronic C54U */ | ||
| 71 | {USB_DEVICE(0x5041, 0x2234)}, /* Linksys WUSB54G */ | 73 | {USB_DEVICE(0x5041, 0x2234)}, /* Linksys WUSB54G */ |
| 72 | {USB_DEVICE(0x5041, 0x2235)}, /* Linksys WUSB54G Portable */ | 74 | {USB_DEVICE(0x5041, 0x2235)}, /* Linksys WUSB54G Portable */ |
| 73 | 75 | ||
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c index 9de9dbe94399..84eb6ad36377 100644 --- a/drivers/net/wireless/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/rt2x00/rt2x00dev.c | |||
| @@ -1062,8 +1062,10 @@ void rt2x00lib_remove_dev(struct rt2x00_dev *rt2x00dev) | |||
| 1062 | * Stop all work. | 1062 | * Stop all work. |
| 1063 | */ | 1063 | */ |
| 1064 | cancel_work_sync(&rt2x00dev->intf_work); | 1064 | cancel_work_sync(&rt2x00dev->intf_work); |
| 1065 | cancel_work_sync(&rt2x00dev->rxdone_work); | 1065 | if (rt2x00_is_usb(rt2x00dev)) { |
| 1066 | cancel_work_sync(&rt2x00dev->txdone_work); | 1066 | cancel_work_sync(&rt2x00dev->rxdone_work); |
| 1067 | cancel_work_sync(&rt2x00dev->txdone_work); | ||
| 1068 | } | ||
| 1067 | destroy_workqueue(rt2x00dev->workqueue); | 1069 | destroy_workqueue(rt2x00dev->workqueue); |
| 1068 | 1070 | ||
| 1069 | /* | 1071 | /* |
diff --git a/drivers/net/wireless/rtlwifi/efuse.c b/drivers/net/wireless/rtlwifi/efuse.c index f74a8701c67d..590f14f45a89 100644 --- a/drivers/net/wireless/rtlwifi/efuse.c +++ b/drivers/net/wireless/rtlwifi/efuse.c | |||
| @@ -685,7 +685,7 @@ static int efuse_pg_packet_read(struct ieee80211_hw *hw, u8 offset, u8 *data) | |||
| 685 | 685 | ||
| 686 | u8 efuse_data, word_cnts = 0; | 686 | u8 efuse_data, word_cnts = 0; |
| 687 | u16 efuse_addr = 0; | 687 | u16 efuse_addr = 0; |
| 688 | u8 hworden; | 688 | u8 hworden = 0; |
| 689 | u8 tmpdata[8]; | 689 | u8 tmpdata[8]; |
| 690 | 690 | ||
| 691 | if (data == NULL) | 691 | if (data == NULL) |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c b/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c index 5ef91374b230..28a6ce3bc239 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c +++ b/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c | |||
| @@ -303,7 +303,7 @@ static void _rtl92c_fill_h2c_command(struct ieee80211_hw *hw, | |||
| 303 | u16 box_reg, box_extreg; | 303 | u16 box_reg, box_extreg; |
| 304 | u8 u1b_tmp; | 304 | u8 u1b_tmp; |
| 305 | bool isfw_read = false; | 305 | bool isfw_read = false; |
| 306 | u8 buf_index; | 306 | u8 buf_index = 0; |
| 307 | bool bwrite_sucess = false; | 307 | bool bwrite_sucess = false; |
| 308 | u8 wait_h2c_limmit = 100; | 308 | u8 wait_h2c_limmit = 100; |
| 309 | u8 wait_writeh2c_limmit = 100; | 309 | u8 wait_writeh2c_limmit = 100; |
diff --git a/drivers/net/wireless/rtlwifi/usb.c b/drivers/net/wireless/rtlwifi/usb.c index a4b2613d6a8c..f5d85735d642 100644 --- a/drivers/net/wireless/rtlwifi/usb.c +++ b/drivers/net/wireless/rtlwifi/usb.c | |||
| @@ -246,7 +246,7 @@ static void _rtl_usb_io_handler_init(struct device *dev, | |||
| 246 | 246 | ||
| 247 | static void _rtl_usb_io_handler_release(struct ieee80211_hw *hw) | 247 | static void _rtl_usb_io_handler_release(struct ieee80211_hw *hw) |
| 248 | { | 248 | { |
| 249 | struct rtl_priv *rtlpriv = rtl_priv(hw); | 249 | struct rtl_priv __maybe_unused *rtlpriv = rtl_priv(hw); |
| 250 | 250 | ||
| 251 | mutex_destroy(&rtlpriv->io.bb_mutex); | 251 | mutex_destroy(&rtlpriv->io.bb_mutex); |
| 252 | } | 252 | } |
diff --git a/drivers/net/wireless/wl12xx/sdio.c b/drivers/net/wireless/wl12xx/sdio.c index 5b9dbeafec06..b1c7d031c391 100644 --- a/drivers/net/wireless/wl12xx/sdio.c +++ b/drivers/net/wireless/wl12xx/sdio.c | |||
| @@ -340,7 +340,7 @@ module_init(wl1271_init); | |||
| 340 | module_exit(wl1271_exit); | 340 | module_exit(wl1271_exit); |
| 341 | 341 | ||
| 342 | MODULE_LICENSE("GPL"); | 342 | MODULE_LICENSE("GPL"); |
| 343 | MODULE_AUTHOR("Luciano Coelho <luciano.coelho@nokia.com>"); | 343 | MODULE_AUTHOR("Luciano Coelho <coelho@ti.com>"); |
| 344 | MODULE_AUTHOR("Juuso Oikarinen <juuso.oikarinen@nokia.com>"); | 344 | MODULE_AUTHOR("Juuso Oikarinen <juuso.oikarinen@nokia.com>"); |
| 345 | MODULE_FIRMWARE(WL1271_FW_NAME); | 345 | MODULE_FIRMWARE(WL1271_FW_NAME); |
| 346 | MODULE_FIRMWARE(WL1271_AP_FW_NAME); | 346 | MODULE_FIRMWARE(WL1271_AP_FW_NAME); |
diff --git a/drivers/net/wireless/wl12xx/spi.c b/drivers/net/wireless/wl12xx/spi.c index 18cf01719ae0..ffc745b17f4d 100644 --- a/drivers/net/wireless/wl12xx/spi.c +++ b/drivers/net/wireless/wl12xx/spi.c | |||
| @@ -487,7 +487,7 @@ module_init(wl1271_init); | |||
| 487 | module_exit(wl1271_exit); | 487 | module_exit(wl1271_exit); |
| 488 | 488 | ||
| 489 | MODULE_LICENSE("GPL"); | 489 | MODULE_LICENSE("GPL"); |
| 490 | MODULE_AUTHOR("Luciano Coelho <luciano.coelho@nokia.com>"); | 490 | MODULE_AUTHOR("Luciano Coelho <coelho@ti.com>"); |
| 491 | MODULE_AUTHOR("Juuso Oikarinen <juuso.oikarinen@nokia.com>"); | 491 | MODULE_AUTHOR("Juuso Oikarinen <juuso.oikarinen@nokia.com>"); |
| 492 | MODULE_FIRMWARE(WL1271_FW_NAME); | 492 | MODULE_FIRMWARE(WL1271_FW_NAME); |
| 493 | MODULE_FIRMWARE(WL1271_AP_FW_NAME); | 493 | MODULE_FIRMWARE(WL1271_AP_FW_NAME); |
diff --git a/drivers/net/wireless/wl12xx/testmode.c b/drivers/net/wireless/wl12xx/testmode.c index e64403b6896d..6ec06a4a4c6d 100644 --- a/drivers/net/wireless/wl12xx/testmode.c +++ b/drivers/net/wireless/wl12xx/testmode.c | |||
| @@ -204,7 +204,10 @@ static int wl1271_tm_cmd_nvs_push(struct wl1271 *wl, struct nlattr *tb[]) | |||
| 204 | 204 | ||
| 205 | kfree(wl->nvs); | 205 | kfree(wl->nvs); |
| 206 | 206 | ||
| 207 | wl->nvs = kzalloc(sizeof(struct wl1271_nvs_file), GFP_KERNEL); | 207 | if (len != sizeof(struct wl1271_nvs_file)) |
| 208 | return -EINVAL; | ||
| 209 | |||
| 210 | wl->nvs = kzalloc(len, GFP_KERNEL); | ||
| 208 | if (!wl->nvs) { | 211 | if (!wl->nvs) { |
| 209 | wl1271_error("could not allocate memory for the nvs file"); | 212 | wl1271_error("could not allocate memory for the nvs file"); |
| 210 | ret = -ENOMEM; | 213 | ret = -ENOMEM; |
diff --git a/drivers/net/wireless/zd1211rw/zd_usb.c b/drivers/net/wireless/zd1211rw/zd_usb.c index 58236e6d0921..ab607bbd6291 100644 --- a/drivers/net/wireless/zd1211rw/zd_usb.c +++ b/drivers/net/wireless/zd1211rw/zd_usb.c | |||
| @@ -643,7 +643,7 @@ static void rx_urb_complete(struct urb *urb) | |||
| 643 | usb = urb->context; | 643 | usb = urb->context; |
| 644 | rx = &usb->rx; | 644 | rx = &usb->rx; |
| 645 | 645 | ||
| 646 | zd_usb_reset_rx_idle_timer(usb); | 646 | tasklet_schedule(&rx->reset_timer_tasklet); |
| 647 | 647 | ||
| 648 | if (length%rx->usb_packet_size > rx->usb_packet_size-4) { | 648 | if (length%rx->usb_packet_size > rx->usb_packet_size-4) { |
| 649 | /* If there is an old first fragment, we don't care. */ | 649 | /* If there is an old first fragment, we don't care. */ |
| @@ -812,6 +812,7 @@ void zd_usb_disable_rx(struct zd_usb *usb) | |||
| 812 | __zd_usb_disable_rx(usb); | 812 | __zd_usb_disable_rx(usb); |
| 813 | mutex_unlock(&rx->setup_mutex); | 813 | mutex_unlock(&rx->setup_mutex); |
| 814 | 814 | ||
| 815 | tasklet_kill(&rx->reset_timer_tasklet); | ||
| 815 | cancel_delayed_work_sync(&rx->idle_work); | 816 | cancel_delayed_work_sync(&rx->idle_work); |
| 816 | } | 817 | } |
| 817 | 818 | ||
| @@ -1106,6 +1107,13 @@ static void zd_rx_idle_timer_handler(struct work_struct *work) | |||
| 1106 | zd_usb_reset_rx(usb); | 1107 | zd_usb_reset_rx(usb); |
| 1107 | } | 1108 | } |
| 1108 | 1109 | ||
| 1110 | static void zd_usb_reset_rx_idle_timer_tasklet(unsigned long param) | ||
| 1111 | { | ||
| 1112 | struct zd_usb *usb = (struct zd_usb *)param; | ||
| 1113 | |||
| 1114 | zd_usb_reset_rx_idle_timer(usb); | ||
| 1115 | } | ||
| 1116 | |||
| 1109 | void zd_usb_reset_rx_idle_timer(struct zd_usb *usb) | 1117 | void zd_usb_reset_rx_idle_timer(struct zd_usb *usb) |
| 1110 | { | 1118 | { |
| 1111 | struct zd_usb_rx *rx = &usb->rx; | 1119 | struct zd_usb_rx *rx = &usb->rx; |
| @@ -1127,6 +1135,7 @@ static inline void init_usb_interrupt(struct zd_usb *usb) | |||
| 1127 | static inline void init_usb_rx(struct zd_usb *usb) | 1135 | static inline void init_usb_rx(struct zd_usb *usb) |
| 1128 | { | 1136 | { |
| 1129 | struct zd_usb_rx *rx = &usb->rx; | 1137 | struct zd_usb_rx *rx = &usb->rx; |
| 1138 | |||
| 1130 | spin_lock_init(&rx->lock); | 1139 | spin_lock_init(&rx->lock); |
| 1131 | mutex_init(&rx->setup_mutex); | 1140 | mutex_init(&rx->setup_mutex); |
| 1132 | if (interface_to_usbdev(usb->intf)->speed == USB_SPEED_HIGH) { | 1141 | if (interface_to_usbdev(usb->intf)->speed == USB_SPEED_HIGH) { |
| @@ -1136,11 +1145,14 @@ static inline void init_usb_rx(struct zd_usb *usb) | |||
| 1136 | } | 1145 | } |
| 1137 | ZD_ASSERT(rx->fragment_length == 0); | 1146 | ZD_ASSERT(rx->fragment_length == 0); |
| 1138 | INIT_DELAYED_WORK(&rx->idle_work, zd_rx_idle_timer_handler); | 1147 | INIT_DELAYED_WORK(&rx->idle_work, zd_rx_idle_timer_handler); |
| 1148 | rx->reset_timer_tasklet.func = zd_usb_reset_rx_idle_timer_tasklet; | ||
| 1149 | rx->reset_timer_tasklet.data = (unsigned long)usb; | ||
| 1139 | } | 1150 | } |
| 1140 | 1151 | ||
| 1141 | static inline void init_usb_tx(struct zd_usb *usb) | 1152 | static inline void init_usb_tx(struct zd_usb *usb) |
| 1142 | { | 1153 | { |
| 1143 | struct zd_usb_tx *tx = &usb->tx; | 1154 | struct zd_usb_tx *tx = &usb->tx; |
| 1155 | |||
| 1144 | spin_lock_init(&tx->lock); | 1156 | spin_lock_init(&tx->lock); |
| 1145 | atomic_set(&tx->enabled, 0); | 1157 | atomic_set(&tx->enabled, 0); |
| 1146 | tx->stopped = 0; | 1158 | tx->stopped = 0; |
| @@ -1671,6 +1683,10 @@ static void iowrite16v_urb_complete(struct urb *urb) | |||
| 1671 | 1683 | ||
| 1672 | if (urb->status && !usb->cmd_error) | 1684 | if (urb->status && !usb->cmd_error) |
| 1673 | usb->cmd_error = urb->status; | 1685 | usb->cmd_error = urb->status; |
| 1686 | |||
| 1687 | if (!usb->cmd_error && | ||
| 1688 | urb->actual_length != urb->transfer_buffer_length) | ||
| 1689 | usb->cmd_error = -EIO; | ||
| 1674 | } | 1690 | } |
| 1675 | 1691 | ||
| 1676 | static int zd_submit_waiting_urb(struct zd_usb *usb, bool last) | 1692 | static int zd_submit_waiting_urb(struct zd_usb *usb, bool last) |
| @@ -1805,7 +1821,7 @@ int zd_usb_iowrite16v_async(struct zd_usb *usb, const struct zd_ioreq16 *ioreqs, | |||
| 1805 | usb_fill_int_urb(urb, udev, usb_sndintpipe(udev, EP_REGS_OUT), | 1821 | usb_fill_int_urb(urb, udev, usb_sndintpipe(udev, EP_REGS_OUT), |
| 1806 | req, req_len, iowrite16v_urb_complete, usb, | 1822 | req, req_len, iowrite16v_urb_complete, usb, |
| 1807 | ep->desc.bInterval); | 1823 | ep->desc.bInterval); |
| 1808 | urb->transfer_flags |= URB_FREE_BUFFER | URB_SHORT_NOT_OK; | 1824 | urb->transfer_flags |= URB_FREE_BUFFER; |
| 1809 | 1825 | ||
| 1810 | /* Submit previous URB */ | 1826 | /* Submit previous URB */ |
| 1811 | r = zd_submit_waiting_urb(usb, false); | 1827 | r = zd_submit_waiting_urb(usb, false); |
diff --git a/drivers/net/wireless/zd1211rw/zd_usb.h b/drivers/net/wireless/zd1211rw/zd_usb.h index b3df2c8116cc..325d0f989257 100644 --- a/drivers/net/wireless/zd1211rw/zd_usb.h +++ b/drivers/net/wireless/zd1211rw/zd_usb.h | |||
| @@ -183,6 +183,7 @@ struct zd_usb_rx { | |||
| 183 | spinlock_t lock; | 183 | spinlock_t lock; |
| 184 | struct mutex setup_mutex; | 184 | struct mutex setup_mutex; |
| 185 | struct delayed_work idle_work; | 185 | struct delayed_work idle_work; |
| 186 | struct tasklet_struct reset_timer_tasklet; | ||
| 186 | u8 fragment[2 * USB_MAX_RX_SIZE]; | 187 | u8 fragment[2 * USB_MAX_RX_SIZE]; |
| 187 | unsigned int fragment_length; | 188 | unsigned int fragment_length; |
| 188 | unsigned int usb_packet_size; | 189 | unsigned int usb_packet_size; |
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c index d86ea8b01137..135df164a4c1 100644 --- a/drivers/pci/pci-driver.c +++ b/drivers/pci/pci-driver.c | |||
| @@ -781,7 +781,7 @@ static int pci_pm_resume(struct device *dev) | |||
| 781 | 781 | ||
| 782 | #endif /* !CONFIG_SUSPEND */ | 782 | #endif /* !CONFIG_SUSPEND */ |
| 783 | 783 | ||
| 784 | #ifdef CONFIG_HIBERNATION | 784 | #ifdef CONFIG_HIBERNATE_CALLBACKS |
| 785 | 785 | ||
| 786 | static int pci_pm_freeze(struct device *dev) | 786 | static int pci_pm_freeze(struct device *dev) |
| 787 | { | 787 | { |
| @@ -970,7 +970,7 @@ static int pci_pm_restore(struct device *dev) | |||
| 970 | return error; | 970 | return error; |
| 971 | } | 971 | } |
| 972 | 972 | ||
| 973 | #else /* !CONFIG_HIBERNATION */ | 973 | #else /* !CONFIG_HIBERNATE_CALLBACKS */ |
| 974 | 974 | ||
| 975 | #define pci_pm_freeze NULL | 975 | #define pci_pm_freeze NULL |
| 976 | #define pci_pm_freeze_noirq NULL | 976 | #define pci_pm_freeze_noirq NULL |
| @@ -981,7 +981,7 @@ static int pci_pm_restore(struct device *dev) | |||
| 981 | #define pci_pm_restore NULL | 981 | #define pci_pm_restore NULL |
| 982 | #define pci_pm_restore_noirq NULL | 982 | #define pci_pm_restore_noirq NULL |
| 983 | 983 | ||
| 984 | #endif /* !CONFIG_HIBERNATION */ | 984 | #endif /* !CONFIG_HIBERNATE_CALLBACKS */ |
| 985 | 985 | ||
| 986 | #ifdef CONFIG_PM_RUNTIME | 986 | #ifdef CONFIG_PM_RUNTIME |
| 987 | 987 | ||
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index 89d0a6a88df7..ebf51ad1b714 100644 --- a/drivers/pci/setup-bus.c +++ b/drivers/pci/setup-bus.c | |||
| @@ -676,10 +676,10 @@ static int pbus_size_mem(struct pci_bus *bus, unsigned long mask, | |||
| 676 | min_align = align1 >> 1; | 676 | min_align = align1 >> 1; |
| 677 | align += aligns[order]; | 677 | align += aligns[order]; |
| 678 | } | 678 | } |
| 679 | size0 = calculate_memsize(size, min_size, 0, resource_size(b_res), align); | 679 | size0 = calculate_memsize(size, min_size, 0, resource_size(b_res), min_align); |
| 680 | size1 = !add_size ? size : | 680 | size1 = !add_size ? size : |
| 681 | calculate_memsize(size, min_size+add_size, 0, | 681 | calculate_memsize(size, min_size+add_size, 0, |
| 682 | resource_size(b_res), align); | 682 | resource_size(b_res), min_align); |
| 683 | if (!size0 && !size1) { | 683 | if (!size0 && !size1) { |
| 684 | if (b_res->start || b_res->end) | 684 | if (b_res->start || b_res->end) |
| 685 | dev_info(&bus->self->dev, "disabling bridge window " | 685 | dev_info(&bus->self->dev, "disabling bridge window " |
diff --git a/drivers/pcmcia/pxa2xx_balloon3.c b/drivers/pcmcia/pxa2xx_balloon3.c index 453c54c97612..4c3e94c0ae85 100644 --- a/drivers/pcmcia/pxa2xx_balloon3.c +++ b/drivers/pcmcia/pxa2xx_balloon3.c | |||
| @@ -25,6 +25,8 @@ | |||
| 25 | 25 | ||
| 26 | #include <mach/balloon3.h> | 26 | #include <mach/balloon3.h> |
| 27 | 27 | ||
| 28 | #include <asm/mach-types.h> | ||
| 29 | |||
| 28 | #include "soc_common.h" | 30 | #include "soc_common.h" |
| 29 | 31 | ||
| 30 | /* | 32 | /* |
| @@ -127,6 +129,9 @@ static int __init balloon3_pcmcia_init(void) | |||
| 127 | { | 129 | { |
| 128 | int ret; | 130 | int ret; |
| 129 | 131 | ||
| 132 | if (!machine_is_balloon3()) | ||
| 133 | return -ENODEV; | ||
| 134 | |||
| 130 | balloon3_pcmcia_device = platform_device_alloc("pxa2xx-pcmcia", -1); | 135 | balloon3_pcmcia_device = platform_device_alloc("pxa2xx-pcmcia", -1); |
| 131 | if (!balloon3_pcmcia_device) | 136 | if (!balloon3_pcmcia_device) |
| 132 | return -ENOMEM; | 137 | return -ENOMEM; |
diff --git a/drivers/pcmcia/pxa2xx_trizeps4.c b/drivers/pcmcia/pxa2xx_trizeps4.c index b7e596620db1..b829e655457b 100644 --- a/drivers/pcmcia/pxa2xx_trizeps4.c +++ b/drivers/pcmcia/pxa2xx_trizeps4.c | |||
| @@ -69,15 +69,15 @@ static int trizeps_pcmcia_hw_init(struct soc_pcmcia_socket *skt) | |||
| 69 | for (i = 0; i < ARRAY_SIZE(irqs); i++) { | 69 | for (i = 0; i < ARRAY_SIZE(irqs); i++) { |
| 70 | if (irqs[i].sock != skt->nr) | 70 | if (irqs[i].sock != skt->nr) |
| 71 | continue; | 71 | continue; |
| 72 | if (gpio_request(IRQ_TO_GPIO(irqs[i].irq), irqs[i].str) < 0) { | 72 | if (gpio_request(irq_to_gpio(irqs[i].irq), irqs[i].str) < 0) { |
| 73 | pr_err("%s: sock %d unable to request gpio %d\n", | 73 | pr_err("%s: sock %d unable to request gpio %d\n", |
| 74 | __func__, skt->nr, IRQ_TO_GPIO(irqs[i].irq)); | 74 | __func__, skt->nr, irq_to_gpio(irqs[i].irq)); |
| 75 | ret = -EBUSY; | 75 | ret = -EBUSY; |
| 76 | goto error; | 76 | goto error; |
| 77 | } | 77 | } |
| 78 | if (gpio_direction_input(IRQ_TO_GPIO(irqs[i].irq)) < 0) { | 78 | if (gpio_direction_input(irq_to_gpio(irqs[i].irq)) < 0) { |
| 79 | pr_err("%s: sock %d unable to set input gpio %d\n", | 79 | pr_err("%s: sock %d unable to set input gpio %d\n", |
| 80 | __func__, skt->nr, IRQ_TO_GPIO(irqs[i].irq)); | 80 | __func__, skt->nr, irq_to_gpio(irqs[i].irq)); |
| 81 | ret = -EINVAL; | 81 | ret = -EINVAL; |
| 82 | goto error; | 82 | goto error; |
| 83 | } | 83 | } |
| @@ -86,7 +86,7 @@ static int trizeps_pcmcia_hw_init(struct soc_pcmcia_socket *skt) | |||
| 86 | 86 | ||
| 87 | error: | 87 | error: |
| 88 | for (; i >= 0; i--) { | 88 | for (; i >= 0; i--) { |
| 89 | gpio_free(IRQ_TO_GPIO(irqs[i].irq)); | 89 | gpio_free(irq_to_gpio(irqs[i].irq)); |
| 90 | } | 90 | } |
| 91 | return (ret); | 91 | return (ret); |
| 92 | } | 92 | } |
| @@ -97,7 +97,7 @@ static void trizeps_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt) | |||
| 97 | /* free allocated gpio's */ | 97 | /* free allocated gpio's */ |
| 98 | gpio_free(GPIO_PRDY); | 98 | gpio_free(GPIO_PRDY); |
| 99 | for (i = 0; i < ARRAY_SIZE(irqs); i++) | 99 | for (i = 0; i < ARRAY_SIZE(irqs); i++) |
| 100 | gpio_free(IRQ_TO_GPIO(irqs[i].irq)); | 100 | gpio_free(irq_to_gpio(irqs[i].irq)); |
| 101 | } | 101 | } |
| 102 | 102 | ||
| 103 | static unsigned long trizeps_pcmcia_status[2]; | 103 | static unsigned long trizeps_pcmcia_status[2]; |
| @@ -226,6 +226,9 @@ static int __init trizeps_pcmcia_init(void) | |||
| 226 | { | 226 | { |
| 227 | int ret; | 227 | int ret; |
| 228 | 228 | ||
| 229 | if (!machine_is_trizeps4() && !machine_is_trizeps4wl()) | ||
| 230 | return -ENODEV; | ||
| 231 | |||
| 229 | trizeps_pcmcia_device = platform_device_alloc("pxa2xx-pcmcia", -1); | 232 | trizeps_pcmcia_device = platform_device_alloc("pxa2xx-pcmcia", -1); |
| 230 | if (!trizeps_pcmcia_device) | 233 | if (!trizeps_pcmcia_device) |
| 231 | return -ENOMEM; | 234 | return -ENOMEM; |
diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig index 2ee442c2a5db..0485e394712a 100644 --- a/drivers/platform/x86/Kconfig +++ b/drivers/platform/x86/Kconfig | |||
| @@ -187,7 +187,8 @@ config MSI_LAPTOP | |||
| 187 | depends on ACPI | 187 | depends on ACPI |
| 188 | depends on BACKLIGHT_CLASS_DEVICE | 188 | depends on BACKLIGHT_CLASS_DEVICE |
| 189 | depends on RFKILL | 189 | depends on RFKILL |
| 190 | depends on SERIO_I8042 | 190 | depends on INPUT && SERIO_I8042 |
| 191 | select INPUT_SPARSEKMAP | ||
| 191 | ---help--- | 192 | ---help--- |
| 192 | This is a driver for laptops built by MSI (MICRO-STAR | 193 | This is a driver for laptops built by MSI (MICRO-STAR |
| 193 | INTERNATIONAL): | 194 | INTERNATIONAL): |
diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c index 5ea6c3477d17..ac4e7f83ce6c 100644 --- a/drivers/platform/x86/acer-wmi.c +++ b/drivers/platform/x86/acer-wmi.c | |||
| @@ -89,7 +89,7 @@ MODULE_LICENSE("GPL"); | |||
| 89 | #define ACERWMID_EVENT_GUID "676AA15E-6A47-4D9F-A2CC-1E6D18D14026" | 89 | #define ACERWMID_EVENT_GUID "676AA15E-6A47-4D9F-A2CC-1E6D18D14026" |
| 90 | 90 | ||
| 91 | MODULE_ALIAS("wmi:67C3371D-95A3-4C37-BB61-DD47B491DAAB"); | 91 | MODULE_ALIAS("wmi:67C3371D-95A3-4C37-BB61-DD47B491DAAB"); |
| 92 | MODULE_ALIAS("wmi:6AF4F258-B401-42Fd-BE91-3D4AC2D7C0D3"); | 92 | MODULE_ALIAS("wmi:6AF4F258-B401-42FD-BE91-3D4AC2D7C0D3"); |
| 93 | MODULE_ALIAS("wmi:676AA15E-6A47-4D9F-A2CC-1E6D18D14026"); | 93 | MODULE_ALIAS("wmi:676AA15E-6A47-4D9F-A2CC-1E6D18D14026"); |
| 94 | 94 | ||
| 95 | enum acer_wmi_event_ids { | 95 | enum acer_wmi_event_ids { |
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c index efc776cb0c66..832a3fd7c1c8 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c | |||
| @@ -201,8 +201,8 @@ static int asus_wmi_input_init(struct asus_wmi *asus) | |||
| 201 | if (!asus->inputdev) | 201 | if (!asus->inputdev) |
| 202 | return -ENOMEM; | 202 | return -ENOMEM; |
| 203 | 203 | ||
| 204 | asus->inputdev->name = asus->driver->input_phys; | 204 | asus->inputdev->name = asus->driver->input_name; |
| 205 | asus->inputdev->phys = asus->driver->input_name; | 205 | asus->inputdev->phys = asus->driver->input_phys; |
| 206 | asus->inputdev->id.bustype = BUS_HOST; | 206 | asus->inputdev->id.bustype = BUS_HOST; |
| 207 | asus->inputdev->dev.parent = &asus->platform_device->dev; | 207 | asus->inputdev->dev.parent = &asus->platform_device->dev; |
| 208 | 208 | ||
diff --git a/drivers/platform/x86/eeepc-wmi.c b/drivers/platform/x86/eeepc-wmi.c index 0ddc434fb93b..649dcadd8ea3 100644 --- a/drivers/platform/x86/eeepc-wmi.c +++ b/drivers/platform/x86/eeepc-wmi.c | |||
| @@ -67,9 +67,11 @@ static const struct key_entry eeepc_wmi_keymap[] = { | |||
| 67 | { KE_KEY, 0x82, { KEY_CAMERA } }, | 67 | { KE_KEY, 0x82, { KEY_CAMERA } }, |
| 68 | { KE_KEY, 0x83, { KEY_CAMERA_ZOOMIN } }, | 68 | { KE_KEY, 0x83, { KEY_CAMERA_ZOOMIN } }, |
| 69 | { KE_KEY, 0x88, { KEY_WLAN } }, | 69 | { KE_KEY, 0x88, { KEY_WLAN } }, |
| 70 | { KE_KEY, 0xbd, { KEY_CAMERA } }, | ||
| 70 | { KE_KEY, 0xcc, { KEY_SWITCHVIDEOMODE } }, | 71 | { KE_KEY, 0xcc, { KEY_SWITCHVIDEOMODE } }, |
| 71 | { KE_KEY, 0xe0, { KEY_PROG1 } }, /* Task Manager */ | 72 | { KE_KEY, 0xe0, { KEY_PROG1 } }, /* Task Manager */ |
| 72 | { KE_KEY, 0xe1, { KEY_F14 } }, /* Change Resolution */ | 73 | { KE_KEY, 0xe1, { KEY_F14 } }, /* Change Resolution */ |
| 74 | { KE_KEY, 0xe8, { KEY_SCREENLOCK } }, | ||
| 73 | { KE_KEY, 0xe9, { KEY_BRIGHTNESS_ZERO } }, | 75 | { KE_KEY, 0xe9, { KEY_BRIGHTNESS_ZERO } }, |
| 74 | { KE_KEY, 0xeb, { KEY_CAMERA_ZOOMOUT } }, | 76 | { KE_KEY, 0xeb, { KEY_CAMERA_ZOOMOUT } }, |
| 75 | { KE_KEY, 0xec, { KEY_CAMERA_UP } }, | 77 | { KE_KEY, 0xec, { KEY_CAMERA_UP } }, |
diff --git a/drivers/platform/x86/intel_pmic_gpio.c b/drivers/platform/x86/intel_pmic_gpio.c index d653104b59cb..464bb3fc4d88 100644 --- a/drivers/platform/x86/intel_pmic_gpio.c +++ b/drivers/platform/x86/intel_pmic_gpio.c | |||
| @@ -74,6 +74,19 @@ struct pmic_gpio { | |||
| 74 | u32 trigger_type; | 74 | u32 trigger_type; |
| 75 | }; | 75 | }; |
| 76 | 76 | ||
| 77 | static void pmic_program_irqtype(int gpio, int type) | ||
| 78 | { | ||
| 79 | if (type & IRQ_TYPE_EDGE_RISING) | ||
| 80 | intel_scu_ipc_update_register(GPIO0 + gpio, 0x20, 0x20); | ||
| 81 | else | ||
| 82 | intel_scu_ipc_update_register(GPIO0 + gpio, 0x00, 0x20); | ||
| 83 | |||
| 84 | if (type & IRQ_TYPE_EDGE_FALLING) | ||
| 85 | intel_scu_ipc_update_register(GPIO0 + gpio, 0x10, 0x10); | ||
| 86 | else | ||
| 87 | intel_scu_ipc_update_register(GPIO0 + gpio, 0x00, 0x10); | ||
| 88 | }; | ||
| 89 | |||
| 77 | static int pmic_gpio_direction_input(struct gpio_chip *chip, unsigned offset) | 90 | static int pmic_gpio_direction_input(struct gpio_chip *chip, unsigned offset) |
| 78 | { | 91 | { |
| 79 | if (offset > 8) { | 92 | if (offset > 8) { |
| @@ -166,16 +179,38 @@ static int pmic_gpio_to_irq(struct gpio_chip *chip, unsigned offset) | |||
| 166 | return pg->irq_base + offset; | 179 | return pg->irq_base + offset; |
| 167 | } | 180 | } |
| 168 | 181 | ||
| 182 | static void pmic_bus_lock(struct irq_data *data) | ||
| 183 | { | ||
| 184 | struct pmic_gpio *pg = irq_data_get_irq_chip_data(data); | ||
| 185 | |||
| 186 | mutex_lock(&pg->buslock); | ||
| 187 | } | ||
| 188 | |||
| 189 | static void pmic_bus_sync_unlock(struct irq_data *data) | ||
| 190 | { | ||
| 191 | struct pmic_gpio *pg = irq_data_get_irq_chip_data(data); | ||
| 192 | |||
| 193 | if (pg->update_type) { | ||
| 194 | unsigned int gpio = pg->update_type & ~GPIO_UPDATE_TYPE; | ||
| 195 | |||
| 196 | pmic_program_irqtype(gpio, pg->trigger_type); | ||
| 197 | pg->update_type = 0; | ||
| 198 | } | ||
| 199 | mutex_unlock(&pg->buslock); | ||
| 200 | } | ||
| 201 | |||
| 169 | /* the gpiointr register is read-clear, so just do nothing. */ | 202 | /* the gpiointr register is read-clear, so just do nothing. */ |
| 170 | static void pmic_irq_unmask(struct irq_data *data) { } | 203 | static void pmic_irq_unmask(struct irq_data *data) { } |
| 171 | 204 | ||
| 172 | static void pmic_irq_mask(struct irq_data *data) { } | 205 | static void pmic_irq_mask(struct irq_data *data) { } |
| 173 | 206 | ||
| 174 | static struct irq_chip pmic_irqchip = { | 207 | static struct irq_chip pmic_irqchip = { |
| 175 | .name = "PMIC-GPIO", | 208 | .name = "PMIC-GPIO", |
| 176 | .irq_mask = pmic_irq_mask, | 209 | .irq_mask = pmic_irq_mask, |
| 177 | .irq_unmask = pmic_irq_unmask, | 210 | .irq_unmask = pmic_irq_unmask, |
| 178 | .irq_set_type = pmic_irq_type, | 211 | .irq_set_type = pmic_irq_type, |
| 212 | .irq_bus_lock = pmic_bus_lock, | ||
| 213 | .irq_bus_sync_unlock = pmic_bus_sync_unlock, | ||
| 179 | }; | 214 | }; |
| 180 | 215 | ||
| 181 | static irqreturn_t pmic_irq_handler(int irq, void *data) | 216 | static irqreturn_t pmic_irq_handler(int irq, void *data) |
diff --git a/drivers/platform/x86/samsung-laptop.c b/drivers/platform/x86/samsung-laptop.c index de434c6dc2d6..d347116d150e 100644 --- a/drivers/platform/x86/samsung-laptop.c +++ b/drivers/platform/x86/samsung-laptop.c | |||
| @@ -571,6 +571,16 @@ static struct dmi_system_id __initdata samsung_dmi_table[] = { | |||
| 571 | .callback = dmi_check_cb, | 571 | .callback = dmi_check_cb, |
| 572 | }, | 572 | }, |
| 573 | { | 573 | { |
| 574 | .ident = "R410 Plus", | ||
| 575 | .matches = { | ||
| 576 | DMI_MATCH(DMI_SYS_VENDOR, | ||
| 577 | "SAMSUNG ELECTRONICS CO., LTD."), | ||
| 578 | DMI_MATCH(DMI_PRODUCT_NAME, "R410P"), | ||
| 579 | DMI_MATCH(DMI_BOARD_NAME, "R460"), | ||
| 580 | }, | ||
| 581 | .callback = dmi_check_cb, | ||
| 582 | }, | ||
| 583 | { | ||
| 574 | .ident = "R518", | 584 | .ident = "R518", |
| 575 | .matches = { | 585 | .matches = { |
| 576 | DMI_MATCH(DMI_SYS_VENDOR, | 586 | DMI_MATCH(DMI_SYS_VENDOR, |
| @@ -591,12 +601,12 @@ static struct dmi_system_id __initdata samsung_dmi_table[] = { | |||
| 591 | .callback = dmi_check_cb, | 601 | .callback = dmi_check_cb, |
| 592 | }, | 602 | }, |
| 593 | { | 603 | { |
| 594 | .ident = "N150/N210/N220", | 604 | .ident = "N150/N210/N220/N230", |
| 595 | .matches = { | 605 | .matches = { |
| 596 | DMI_MATCH(DMI_SYS_VENDOR, | 606 | DMI_MATCH(DMI_SYS_VENDOR, |
| 597 | "SAMSUNG ELECTRONICS CO., LTD."), | 607 | "SAMSUNG ELECTRONICS CO., LTD."), |
| 598 | DMI_MATCH(DMI_PRODUCT_NAME, "N150/N210/N220"), | 608 | DMI_MATCH(DMI_PRODUCT_NAME, "N150/N210/N220/N230"), |
| 599 | DMI_MATCH(DMI_BOARD_NAME, "N150/N210/N220"), | 609 | DMI_MATCH(DMI_BOARD_NAME, "N150/N210/N220/N230"), |
| 600 | }, | 610 | }, |
| 601 | .callback = dmi_check_cb, | 611 | .callback = dmi_check_cb, |
| 602 | }, | 612 | }, |
| @@ -771,6 +781,7 @@ static int __init samsung_init(void) | |||
| 771 | 781 | ||
| 772 | /* create a backlight device to talk to this one */ | 782 | /* create a backlight device to talk to this one */ |
| 773 | memset(&props, 0, sizeof(struct backlight_properties)); | 783 | memset(&props, 0, sizeof(struct backlight_properties)); |
| 784 | props.type = BACKLIGHT_PLATFORM; | ||
| 774 | props.max_brightness = sabi_config->max_brightness; | 785 | props.max_brightness = sabi_config->max_brightness; |
| 775 | backlight_device = backlight_device_register("samsung", &sdev->dev, | 786 | backlight_device = backlight_device_register("samsung", &sdev->dev, |
| 776 | NULL, &backlight_ops, | 787 | NULL, &backlight_ops, |
diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c index e642f5f29504..8f709aec4da0 100644 --- a/drivers/platform/x86/sony-laptop.c +++ b/drivers/platform/x86/sony-laptop.c | |||
| @@ -138,6 +138,8 @@ MODULE_PARM_DESC(kbd_backlight_timeout, | |||
| 138 | "1 for 30 seconds, 2 for 60 seconds and 3 to disable timeout " | 138 | "1 for 30 seconds, 2 for 60 seconds and 3 to disable timeout " |
| 139 | "(default: 0)"); | 139 | "(default: 0)"); |
| 140 | 140 | ||
| 141 | static void sony_nc_kbd_backlight_resume(void); | ||
| 142 | |||
| 141 | enum sony_nc_rfkill { | 143 | enum sony_nc_rfkill { |
| 142 | SONY_WIFI, | 144 | SONY_WIFI, |
| 143 | SONY_BLUETOOTH, | 145 | SONY_BLUETOOTH, |
| @@ -771,11 +773,6 @@ static int sony_nc_handles_setup(struct platform_device *pd) | |||
| 771 | if (!handles) | 773 | if (!handles) |
| 772 | return -ENOMEM; | 774 | return -ENOMEM; |
| 773 | 775 | ||
| 774 | sysfs_attr_init(&handles->devattr.attr); | ||
| 775 | handles->devattr.attr.name = "handles"; | ||
| 776 | handles->devattr.attr.mode = S_IRUGO; | ||
| 777 | handles->devattr.show = sony_nc_handles_show; | ||
| 778 | |||
| 779 | for (i = 0; i < ARRAY_SIZE(handles->cap); i++) { | 776 | for (i = 0; i < ARRAY_SIZE(handles->cap); i++) { |
| 780 | if (!acpi_callsetfunc(sony_nc_acpi_handle, | 777 | if (!acpi_callsetfunc(sony_nc_acpi_handle, |
| 781 | "SN00", i + 0x20, &result)) { | 778 | "SN00", i + 0x20, &result)) { |
| @@ -785,11 +782,18 @@ static int sony_nc_handles_setup(struct platform_device *pd) | |||
| 785 | } | 782 | } |
| 786 | } | 783 | } |
| 787 | 784 | ||
| 788 | /* allow reading capabilities via sysfs */ | 785 | if (debug) { |
| 789 | if (device_create_file(&pd->dev, &handles->devattr)) { | 786 | sysfs_attr_init(&handles->devattr.attr); |
| 790 | kfree(handles); | 787 | handles->devattr.attr.name = "handles"; |
| 791 | handles = NULL; | 788 | handles->devattr.attr.mode = S_IRUGO; |
| 792 | return -1; | 789 | handles->devattr.show = sony_nc_handles_show; |
| 790 | |||
| 791 | /* allow reading capabilities via sysfs */ | ||
| 792 | if (device_create_file(&pd->dev, &handles->devattr)) { | ||
| 793 | kfree(handles); | ||
| 794 | handles = NULL; | ||
| 795 | return -1; | ||
| 796 | } | ||
| 793 | } | 797 | } |
| 794 | 798 | ||
| 795 | return 0; | 799 | return 0; |
| @@ -798,7 +802,8 @@ static int sony_nc_handles_setup(struct platform_device *pd) | |||
| 798 | static int sony_nc_handles_cleanup(struct platform_device *pd) | 802 | static int sony_nc_handles_cleanup(struct platform_device *pd) |
| 799 | { | 803 | { |
| 800 | if (handles) { | 804 | if (handles) { |
| 801 | device_remove_file(&pd->dev, &handles->devattr); | 805 | if (debug) |
| 806 | device_remove_file(&pd->dev, &handles->devattr); | ||
| 802 | kfree(handles); | 807 | kfree(handles); |
| 803 | handles = NULL; | 808 | handles = NULL; |
| 804 | } | 809 | } |
| @@ -808,6 +813,11 @@ static int sony_nc_handles_cleanup(struct platform_device *pd) | |||
| 808 | static int sony_find_snc_handle(int handle) | 813 | static int sony_find_snc_handle(int handle) |
| 809 | { | 814 | { |
| 810 | int i; | 815 | int i; |
| 816 | |||
| 817 | /* not initialized yet, return early */ | ||
| 818 | if (!handles) | ||
| 819 | return -1; | ||
| 820 | |||
| 811 | for (i = 0; i < 0x10; i++) { | 821 | for (i = 0; i < 0x10; i++) { |
| 812 | if (handles->cap[i] == handle) { | 822 | if (handles->cap[i] == handle) { |
| 813 | dprintk("found handle 0x%.4x (offset: 0x%.2x)\n", | 823 | dprintk("found handle 0x%.4x (offset: 0x%.2x)\n", |
| @@ -1168,6 +1178,9 @@ static int sony_nc_resume(struct acpi_device *device) | |||
| 1168 | /* re-read rfkill state */ | 1178 | /* re-read rfkill state */ |
| 1169 | sony_nc_rfkill_update(); | 1179 | sony_nc_rfkill_update(); |
| 1170 | 1180 | ||
| 1181 | /* restore kbd backlight states */ | ||
| 1182 | sony_nc_kbd_backlight_resume(); | ||
| 1183 | |||
| 1171 | return 0; | 1184 | return 0; |
| 1172 | } | 1185 | } |
| 1173 | 1186 | ||
| @@ -1355,6 +1368,7 @@ out_no_enum: | |||
| 1355 | #define KBDBL_HANDLER 0x137 | 1368 | #define KBDBL_HANDLER 0x137 |
| 1356 | #define KBDBL_PRESENT 0xB00 | 1369 | #define KBDBL_PRESENT 0xB00 |
| 1357 | #define SET_MODE 0xC00 | 1370 | #define SET_MODE 0xC00 |
| 1371 | #define SET_STATE 0xD00 | ||
| 1358 | #define SET_TIMEOUT 0xE00 | 1372 | #define SET_TIMEOUT 0xE00 |
| 1359 | 1373 | ||
| 1360 | struct kbd_backlight { | 1374 | struct kbd_backlight { |
| @@ -1377,6 +1391,10 @@ static ssize_t __sony_nc_kbd_backlight_mode_set(u8 value) | |||
| 1377 | (value << 0x10) | SET_MODE, &result)) | 1391 | (value << 0x10) | SET_MODE, &result)) |
| 1378 | return -EIO; | 1392 | return -EIO; |
| 1379 | 1393 | ||
| 1394 | /* Try to turn the light on/off immediately */ | ||
| 1395 | sony_call_snc_handle(KBDBL_HANDLER, (value << 0x10) | SET_STATE, | ||
| 1396 | &result); | ||
| 1397 | |||
| 1380 | kbdbl_handle->mode = value; | 1398 | kbdbl_handle->mode = value; |
| 1381 | 1399 | ||
| 1382 | return 0; | 1400 | return 0; |
| @@ -1458,7 +1476,7 @@ static int sony_nc_kbd_backlight_setup(struct platform_device *pd) | |||
| 1458 | { | 1476 | { |
| 1459 | int result; | 1477 | int result; |
| 1460 | 1478 | ||
| 1461 | if (sony_call_snc_handle(0x137, KBDBL_PRESENT, &result)) | 1479 | if (sony_call_snc_handle(KBDBL_HANDLER, KBDBL_PRESENT, &result)) |
| 1462 | return 0; | 1480 | return 0; |
| 1463 | if (!(result & 0x02)) | 1481 | if (!(result & 0x02)) |
| 1464 | return 0; | 1482 | return 0; |
| @@ -1501,13 +1519,36 @@ outkzalloc: | |||
| 1501 | static int sony_nc_kbd_backlight_cleanup(struct platform_device *pd) | 1519 | static int sony_nc_kbd_backlight_cleanup(struct platform_device *pd) |
| 1502 | { | 1520 | { |
| 1503 | if (kbdbl_handle) { | 1521 | if (kbdbl_handle) { |
| 1522 | int result; | ||
| 1523 | |||
| 1504 | device_remove_file(&pd->dev, &kbdbl_handle->mode_attr); | 1524 | device_remove_file(&pd->dev, &kbdbl_handle->mode_attr); |
| 1505 | device_remove_file(&pd->dev, &kbdbl_handle->timeout_attr); | 1525 | device_remove_file(&pd->dev, &kbdbl_handle->timeout_attr); |
| 1526 | |||
| 1527 | /* restore the default hw behaviour */ | ||
| 1528 | sony_call_snc_handle(KBDBL_HANDLER, 0x1000 | SET_MODE, &result); | ||
| 1529 | sony_call_snc_handle(KBDBL_HANDLER, SET_TIMEOUT, &result); | ||
| 1530 | |||
| 1506 | kfree(kbdbl_handle); | 1531 | kfree(kbdbl_handle); |
| 1507 | } | 1532 | } |
| 1508 | return 0; | 1533 | return 0; |
| 1509 | } | 1534 | } |
| 1510 | 1535 | ||
| 1536 | static void sony_nc_kbd_backlight_resume(void) | ||
| 1537 | { | ||
| 1538 | int ignore = 0; | ||
| 1539 | |||
| 1540 | if (!kbdbl_handle) | ||
| 1541 | return; | ||
| 1542 | |||
| 1543 | if (kbdbl_handle->mode == 0) | ||
| 1544 | sony_call_snc_handle(KBDBL_HANDLER, SET_MODE, &ignore); | ||
| 1545 | |||
| 1546 | if (kbdbl_handle->timeout != 0) | ||
| 1547 | sony_call_snc_handle(KBDBL_HANDLER, | ||
| 1548 | (kbdbl_handle->timeout << 0x10) | SET_TIMEOUT, | ||
| 1549 | &ignore); | ||
| 1550 | } | ||
| 1551 | |||
| 1511 | static void sony_nc_backlight_setup(void) | 1552 | static void sony_nc_backlight_setup(void) |
| 1512 | { | 1553 | { |
| 1513 | acpi_handle unused; | 1554 | acpi_handle unused; |
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index a08561f5349e..efb3b6b9bcdb 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c | |||
| @@ -8618,8 +8618,7 @@ static bool __pure __init tpacpi_is_valid_fw_id(const char* const s, | |||
| 8618 | tpacpi_is_fw_digit(s[1]) && | 8618 | tpacpi_is_fw_digit(s[1]) && |
| 8619 | s[2] == t && s[3] == 'T' && | 8619 | s[2] == t && s[3] == 'T' && |
| 8620 | tpacpi_is_fw_digit(s[4]) && | 8620 | tpacpi_is_fw_digit(s[4]) && |
| 8621 | tpacpi_is_fw_digit(s[5]) && | 8621 | tpacpi_is_fw_digit(s[5]); |
| 8622 | s[6] == 'W' && s[7] == 'W'; | ||
| 8623 | } | 8622 | } |
| 8624 | 8623 | ||
| 8625 | /* returns 0 - probe ok, or < 0 - probe error. | 8624 | /* returns 0 - probe ok, or < 0 - probe error. |
diff --git a/drivers/rapidio/rio.c b/drivers/rapidio/rio.c index c29719cacbca..86c9a091a2ff 100644 --- a/drivers/rapidio/rio.c +++ b/drivers/rapidio/rio.c | |||
| @@ -1171,16 +1171,17 @@ static int rio_hdid_setup(char *str) | |||
| 1171 | 1171 | ||
| 1172 | __setup("riohdid=", rio_hdid_setup); | 1172 | __setup("riohdid=", rio_hdid_setup); |
| 1173 | 1173 | ||
| 1174 | void rio_register_mport(struct rio_mport *port) | 1174 | int rio_register_mport(struct rio_mport *port) |
| 1175 | { | 1175 | { |
| 1176 | if (next_portid >= RIO_MAX_MPORTS) { | 1176 | if (next_portid >= RIO_MAX_MPORTS) { |
| 1177 | pr_err("RIO: reached specified max number of mports\n"); | 1177 | pr_err("RIO: reached specified max number of mports\n"); |
| 1178 | return; | 1178 | return 1; |
| 1179 | } | 1179 | } |
| 1180 | 1180 | ||
| 1181 | port->id = next_portid++; | 1181 | port->id = next_portid++; |
| 1182 | port->host_deviceid = rio_get_hdid(port->id); | 1182 | port->host_deviceid = rio_get_hdid(port->id); |
| 1183 | list_add_tail(&port->node, &rio_mports); | 1183 | list_add_tail(&port->node, &rio_mports); |
| 1184 | return 0; | ||
| 1184 | } | 1185 | } |
| 1185 | 1186 | ||
| 1186 | EXPORT_SYMBOL_GPL(rio_local_get_device_id); | 1187 | EXPORT_SYMBOL_GPL(rio_local_get_device_id); |
diff --git a/drivers/rapidio/switches/idt_gen2.c b/drivers/rapidio/switches/idt_gen2.c index 095016a9dec1..ac2701b22e71 100644 --- a/drivers/rapidio/switches/idt_gen2.c +++ b/drivers/rapidio/switches/idt_gen2.c | |||
| @@ -418,3 +418,4 @@ DECLARE_RIO_SWITCH_INIT(RIO_VID_IDT, RIO_DID_IDTCPS1848, idtg2_switch_init); | |||
| 418 | DECLARE_RIO_SWITCH_INIT(RIO_VID_IDT, RIO_DID_IDTCPS1616, idtg2_switch_init); | 418 | DECLARE_RIO_SWITCH_INIT(RIO_VID_IDT, RIO_DID_IDTCPS1616, idtg2_switch_init); |
| 419 | DECLARE_RIO_SWITCH_INIT(RIO_VID_IDT, RIO_DID_IDTVPS1616, idtg2_switch_init); | 419 | DECLARE_RIO_SWITCH_INIT(RIO_VID_IDT, RIO_DID_IDTVPS1616, idtg2_switch_init); |
| 420 | DECLARE_RIO_SWITCH_INIT(RIO_VID_IDT, RIO_DID_IDTSPS1616, idtg2_switch_init); | 420 | DECLARE_RIO_SWITCH_INIT(RIO_VID_IDT, RIO_DID_IDTSPS1616, idtg2_switch_init); |
| 421 | DECLARE_RIO_SWITCH_INIT(RIO_VID_IDT, RIO_DID_IDTCPS1432, idtg2_switch_init); | ||
diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c index 09b4437b3e61..39013867cbd6 100644 --- a/drivers/rtc/class.c +++ b/drivers/rtc/class.c | |||
| @@ -171,7 +171,7 @@ struct rtc_device *rtc_device_register(const char *name, struct device *dev, | |||
| 171 | err = __rtc_read_alarm(rtc, &alrm); | 171 | err = __rtc_read_alarm(rtc, &alrm); |
| 172 | 172 | ||
| 173 | if (!err && !rtc_valid_tm(&alrm.time)) | 173 | if (!err && !rtc_valid_tm(&alrm.time)) |
| 174 | rtc_set_alarm(rtc, &alrm); | 174 | rtc_initialize_alarm(rtc, &alrm); |
| 175 | 175 | ||
| 176 | strlcpy(rtc->name, name, RTC_DEVICE_NAME_SIZE); | 176 | strlcpy(rtc->name, name, RTC_DEVICE_NAME_SIZE); |
| 177 | dev_set_name(&rtc->dev, "rtc%d", id); | 177 | dev_set_name(&rtc->dev, "rtc%d", id); |
diff --git a/drivers/rtc/interface.c b/drivers/rtc/interface.c index 23719f0acbf6..ef6316acec43 100644 --- a/drivers/rtc/interface.c +++ b/drivers/rtc/interface.c | |||
| @@ -375,6 +375,32 @@ int rtc_set_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm) | |||
| 375 | } | 375 | } |
| 376 | EXPORT_SYMBOL_GPL(rtc_set_alarm); | 376 | EXPORT_SYMBOL_GPL(rtc_set_alarm); |
| 377 | 377 | ||
| 378 | /* Called once per device from rtc_device_register */ | ||
| 379 | int rtc_initialize_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm) | ||
| 380 | { | ||
| 381 | int err; | ||
| 382 | |||
| 383 | err = rtc_valid_tm(&alarm->time); | ||
| 384 | if (err != 0) | ||
| 385 | return err; | ||
| 386 | |||
| 387 | err = mutex_lock_interruptible(&rtc->ops_lock); | ||
| 388 | if (err) | ||
| 389 | return err; | ||
| 390 | |||
| 391 | rtc->aie_timer.node.expires = rtc_tm_to_ktime(alarm->time); | ||
| 392 | rtc->aie_timer.period = ktime_set(0, 0); | ||
| 393 | if (alarm->enabled) { | ||
| 394 | rtc->aie_timer.enabled = 1; | ||
| 395 | timerqueue_add(&rtc->timerqueue, &rtc->aie_timer.node); | ||
| 396 | } | ||
| 397 | mutex_unlock(&rtc->ops_lock); | ||
| 398 | return err; | ||
| 399 | } | ||
| 400 | EXPORT_SYMBOL_GPL(rtc_initialize_alarm); | ||
| 401 | |||
| 402 | |||
| 403 | |||
| 378 | int rtc_alarm_irq_enable(struct rtc_device *rtc, unsigned int enabled) | 404 | int rtc_alarm_irq_enable(struct rtc_device *rtc, unsigned int enabled) |
| 379 | { | 405 | { |
| 380 | int err = mutex_lock_interruptible(&rtc->ops_lock); | 406 | int err = mutex_lock_interruptible(&rtc->ops_lock); |
diff --git a/drivers/rtc/rtc-bfin.c b/drivers/rtc/rtc-bfin.c index a0fc4cf42abf..90d866272c8e 100644 --- a/drivers/rtc/rtc-bfin.c +++ b/drivers/rtc/rtc-bfin.c | |||
| @@ -250,6 +250,8 @@ static int bfin_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled) | |||
| 250 | bfin_rtc_int_set_alarm(rtc); | 250 | bfin_rtc_int_set_alarm(rtc); |
| 251 | else | 251 | else |
| 252 | bfin_rtc_int_clear(~(RTC_ISTAT_ALARM | RTC_ISTAT_ALARM_DAY)); | 252 | bfin_rtc_int_clear(~(RTC_ISTAT_ALARM | RTC_ISTAT_ALARM_DAY)); |
| 253 | |||
| 254 | return 0; | ||
| 253 | } | 255 | } |
| 254 | 256 | ||
| 255 | static int bfin_rtc_read_time(struct device *dev, struct rtc_time *tm) | 257 | static int bfin_rtc_read_time(struct device *dev, struct rtc_time *tm) |
diff --git a/drivers/rtc/rtc-mc13xxx.c b/drivers/rtc/rtc-mc13xxx.c index c42006469559..c5ac03793e79 100644 --- a/drivers/rtc/rtc-mc13xxx.c +++ b/drivers/rtc/rtc-mc13xxx.c | |||
| @@ -401,6 +401,7 @@ const struct platform_device_id mc13xxx_rtc_idtable[] = { | |||
| 401 | }, { | 401 | }, { |
| 402 | .name = "mc13892-rtc", | 402 | .name = "mc13892-rtc", |
| 403 | }, | 403 | }, |
| 404 | { } | ||
| 404 | }; | 405 | }; |
| 405 | 406 | ||
| 406 | static struct platform_driver mc13xxx_rtc_driver = { | 407 | static struct platform_driver mc13xxx_rtc_driver = { |
diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c index 714964913e5e..b3466c491cd3 100644 --- a/drivers/rtc/rtc-s3c.c +++ b/drivers/rtc/rtc-s3c.c | |||
| @@ -336,7 +336,6 @@ static void s3c_rtc_release(struct device *dev) | |||
| 336 | 336 | ||
| 337 | /* do not clear AIE here, it may be needed for wake */ | 337 | /* do not clear AIE here, it may be needed for wake */ |
| 338 | 338 | ||
| 339 | s3c_rtc_setpie(dev, 0); | ||
| 340 | free_irq(s3c_rtc_alarmno, rtc_dev); | 339 | free_irq(s3c_rtc_alarmno, rtc_dev); |
| 341 | free_irq(s3c_rtc_tickno, rtc_dev); | 340 | free_irq(s3c_rtc_tickno, rtc_dev); |
| 342 | } | 341 | } |
| @@ -408,7 +407,6 @@ static int __devexit s3c_rtc_remove(struct platform_device *dev) | |||
| 408 | platform_set_drvdata(dev, NULL); | 407 | platform_set_drvdata(dev, NULL); |
| 409 | rtc_device_unregister(rtc); | 408 | rtc_device_unregister(rtc); |
| 410 | 409 | ||
| 411 | s3c_rtc_setpie(&dev->dev, 0); | ||
| 412 | s3c_rtc_setaie(&dev->dev, 0); | 410 | s3c_rtc_setaie(&dev->dev, 0); |
| 413 | 411 | ||
| 414 | clk_disable(rtc_clk); | 412 | clk_disable(rtc_clk); |
diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c index df14c51f6532..8e04c00cf0ad 100644 --- a/drivers/s390/cio/device.c +++ b/drivers/s390/cio/device.c | |||
| @@ -541,15 +541,24 @@ static ssize_t online_store (struct device *dev, struct device_attribute *attr, | |||
| 541 | int force, ret; | 541 | int force, ret; |
| 542 | unsigned long i; | 542 | unsigned long i; |
| 543 | 543 | ||
| 544 | if (!dev_fsm_final_state(cdev) && | 544 | /* Prevent conflict between multiple on-/offline processing requests. */ |
| 545 | cdev->private->state != DEV_STATE_DISCONNECTED) | ||
| 546 | return -EAGAIN; | ||
| 547 | if (atomic_cmpxchg(&cdev->private->onoff, 0, 1) != 0) | 545 | if (atomic_cmpxchg(&cdev->private->onoff, 0, 1) != 0) |
| 548 | return -EAGAIN; | 546 | return -EAGAIN; |
| 547 | /* Prevent conflict between internal I/Os and on-/offline processing. */ | ||
| 548 | if (!dev_fsm_final_state(cdev) && | ||
| 549 | cdev->private->state != DEV_STATE_DISCONNECTED) { | ||
| 550 | ret = -EAGAIN; | ||
| 551 | goto out_onoff; | ||
| 552 | } | ||
| 553 | /* Prevent conflict between pending work and on-/offline processing.*/ | ||
| 554 | if (work_pending(&cdev->private->todo_work)) { | ||
| 555 | ret = -EAGAIN; | ||
| 556 | goto out_onoff; | ||
| 557 | } | ||
| 549 | 558 | ||
| 550 | if (cdev->drv && !try_module_get(cdev->drv->driver.owner)) { | 559 | if (cdev->drv && !try_module_get(cdev->drv->driver.owner)) { |
| 551 | atomic_set(&cdev->private->onoff, 0); | 560 | ret = -EINVAL; |
| 552 | return -EINVAL; | 561 | goto out_onoff; |
| 553 | } | 562 | } |
| 554 | if (!strncmp(buf, "force\n", count)) { | 563 | if (!strncmp(buf, "force\n", count)) { |
| 555 | force = 1; | 564 | force = 1; |
| @@ -574,6 +583,7 @@ static ssize_t online_store (struct device *dev, struct device_attribute *attr, | |||
| 574 | out: | 583 | out: |
| 575 | if (cdev->drv) | 584 | if (cdev->drv) |
| 576 | module_put(cdev->drv->driver.owner); | 585 | module_put(cdev->drv->driver.owner); |
| 586 | out_onoff: | ||
| 577 | atomic_set(&cdev->private->onoff, 0); | 587 | atomic_set(&cdev->private->onoff, 0); |
| 578 | return (ret < 0) ? ret : count; | 588 | return (ret < 0) ? ret : count; |
| 579 | } | 589 | } |
| @@ -1311,10 +1321,12 @@ static int purge_fn(struct device *dev, void *data) | |||
| 1311 | 1321 | ||
| 1312 | spin_lock_irq(cdev->ccwlock); | 1322 | spin_lock_irq(cdev->ccwlock); |
| 1313 | if (is_blacklisted(id->ssid, id->devno) && | 1323 | if (is_blacklisted(id->ssid, id->devno) && |
| 1314 | (cdev->private->state == DEV_STATE_OFFLINE)) { | 1324 | (cdev->private->state == DEV_STATE_OFFLINE) && |
| 1325 | (atomic_cmpxchg(&cdev->private->onoff, 0, 1) == 0)) { | ||
| 1315 | CIO_MSG_EVENT(3, "ccw: purging 0.%x.%04x\n", id->ssid, | 1326 | CIO_MSG_EVENT(3, "ccw: purging 0.%x.%04x\n", id->ssid, |
| 1316 | id->devno); | 1327 | id->devno); |
| 1317 | ccw_device_sched_todo(cdev, CDEV_TODO_UNREG); | 1328 | ccw_device_sched_todo(cdev, CDEV_TODO_UNREG); |
| 1329 | atomic_set(&cdev->private->onoff, 0); | ||
| 1318 | } | 1330 | } |
| 1319 | spin_unlock_irq(cdev->ccwlock); | 1331 | spin_unlock_irq(cdev->ccwlock); |
| 1320 | /* Abort loop in case of pending signal. */ | 1332 | /* Abort loop in case of pending signal. */ |
diff --git a/drivers/s390/cio/qdio_main.c b/drivers/s390/cio/qdio_main.c index 479c665e9e7c..c532ba929ccd 100644 --- a/drivers/s390/cio/qdio_main.c +++ b/drivers/s390/cio/qdio_main.c | |||
| @@ -1649,26 +1649,26 @@ static int __init init_QDIO(void) | |||
| 1649 | { | 1649 | { |
| 1650 | int rc; | 1650 | int rc; |
| 1651 | 1651 | ||
| 1652 | rc = qdio_setup_init(); | 1652 | rc = qdio_debug_init(); |
| 1653 | if (rc) | 1653 | if (rc) |
| 1654 | return rc; | 1654 | return rc; |
| 1655 | rc = qdio_setup_init(); | ||
| 1656 | if (rc) | ||
| 1657 | goto out_debug; | ||
| 1655 | rc = tiqdio_allocate_memory(); | 1658 | rc = tiqdio_allocate_memory(); |
| 1656 | if (rc) | 1659 | if (rc) |
| 1657 | goto out_cache; | 1660 | goto out_cache; |
| 1658 | rc = qdio_debug_init(); | ||
| 1659 | if (rc) | ||
| 1660 | goto out_ti; | ||
| 1661 | rc = tiqdio_register_thinints(); | 1661 | rc = tiqdio_register_thinints(); |
| 1662 | if (rc) | 1662 | if (rc) |
| 1663 | goto out_debug; | 1663 | goto out_ti; |
| 1664 | return 0; | 1664 | return 0; |
| 1665 | 1665 | ||
| 1666 | out_debug: | ||
| 1667 | qdio_debug_exit(); | ||
| 1668 | out_ti: | 1666 | out_ti: |
| 1669 | tiqdio_free_memory(); | 1667 | tiqdio_free_memory(); |
| 1670 | out_cache: | 1668 | out_cache: |
| 1671 | qdio_setup_exit(); | 1669 | qdio_setup_exit(); |
| 1670 | out_debug: | ||
| 1671 | qdio_debug_exit(); | ||
| 1672 | return rc; | 1672 | return rc; |
| 1673 | } | 1673 | } |
| 1674 | 1674 | ||
| @@ -1676,8 +1676,8 @@ static void __exit exit_QDIO(void) | |||
| 1676 | { | 1676 | { |
| 1677 | tiqdio_unregister_thinints(); | 1677 | tiqdio_unregister_thinints(); |
| 1678 | tiqdio_free_memory(); | 1678 | tiqdio_free_memory(); |
| 1679 | qdio_debug_exit(); | ||
| 1680 | qdio_setup_exit(); | 1679 | qdio_setup_exit(); |
| 1680 | qdio_debug_exit(); | ||
| 1681 | } | 1681 | } |
| 1682 | 1682 | ||
| 1683 | module_init(init_QDIO); | 1683 | module_init(init_QDIO); |
diff --git a/drivers/spi/amba-pl022.c b/drivers/spi/amba-pl022.c index 5825370bad25..08de58e7f59f 100644 --- a/drivers/spi/amba-pl022.c +++ b/drivers/spi/amba-pl022.c | |||
| @@ -1555,7 +1555,7 @@ static int stop_queue(struct pl022 *pl022) | |||
| 1555 | * A wait_queue on the pl022->busy could be used, but then the common | 1555 | * A wait_queue on the pl022->busy could be used, but then the common |
| 1556 | * execution path (pump_messages) would be required to call wake_up or | 1556 | * execution path (pump_messages) would be required to call wake_up or |
| 1557 | * friends on every SPI message. Do this instead */ | 1557 | * friends on every SPI message. Do this instead */ |
| 1558 | while (!list_empty(&pl022->queue) && pl022->busy && limit--) { | 1558 | while ((!list_empty(&pl022->queue) || pl022->busy) && limit--) { |
| 1559 | spin_unlock_irqrestore(&pl022->queue_lock, flags); | 1559 | spin_unlock_irqrestore(&pl022->queue_lock, flags); |
| 1560 | msleep(10); | 1560 | msleep(10); |
| 1561 | spin_lock_irqsave(&pl022->queue_lock, flags); | 1561 | spin_lock_irqsave(&pl022->queue_lock, flags); |
diff --git a/drivers/spi/dw_spi.c b/drivers/spi/dw_spi.c index b1a4b9f503ae..871e337c917f 100644 --- a/drivers/spi/dw_spi.c +++ b/drivers/spi/dw_spi.c | |||
| @@ -821,7 +821,7 @@ static int stop_queue(struct dw_spi *dws) | |||
| 821 | 821 | ||
| 822 | spin_lock_irqsave(&dws->lock, flags); | 822 | spin_lock_irqsave(&dws->lock, flags); |
| 823 | dws->run = QUEUE_STOPPED; | 823 | dws->run = QUEUE_STOPPED; |
| 824 | while (!list_empty(&dws->queue) && dws->busy && limit--) { | 824 | while ((!list_empty(&dws->queue) || dws->busy) && limit--) { |
| 825 | spin_unlock_irqrestore(&dws->lock, flags); | 825 | spin_unlock_irqrestore(&dws->lock, flags); |
| 826 | msleep(10); | 826 | msleep(10); |
| 827 | spin_lock_irqsave(&dws->lock, flags); | 827 | spin_lock_irqsave(&dws->lock, flags); |
diff --git a/drivers/spi/pxa2xx_spi.c b/drivers/spi/pxa2xx_spi.c index 9c74aad6be93..dc25bee8d33f 100644 --- a/drivers/spi/pxa2xx_spi.c +++ b/drivers/spi/pxa2xx_spi.c | |||
| @@ -1493,7 +1493,7 @@ static int stop_queue(struct driver_data *drv_data) | |||
| 1493 | * execution path (pump_messages) would be required to call wake_up or | 1493 | * execution path (pump_messages) would be required to call wake_up or |
| 1494 | * friends on every SPI message. Do this instead */ | 1494 | * friends on every SPI message. Do this instead */ |
| 1495 | drv_data->run = QUEUE_STOPPED; | 1495 | drv_data->run = QUEUE_STOPPED; |
| 1496 | while (!list_empty(&drv_data->queue) && drv_data->busy && limit--) { | 1496 | while ((!list_empty(&drv_data->queue) || drv_data->busy) && limit--) { |
| 1497 | spin_unlock_irqrestore(&drv_data->lock, flags); | 1497 | spin_unlock_irqrestore(&drv_data->lock, flags); |
| 1498 | msleep(10); | 1498 | msleep(10); |
| 1499 | spin_lock_irqsave(&drv_data->lock, flags); | 1499 | spin_lock_irqsave(&drv_data->lock, flags); |
diff --git a/drivers/spi/spi_bfin5xx.c b/drivers/spi/spi_bfin5xx.c index bdb7289a1d22..f706dba165cf 100644 --- a/drivers/spi/spi_bfin5xx.c +++ b/drivers/spi/spi_bfin5xx.c | |||
| @@ -1284,7 +1284,7 @@ static inline int bfin_spi_stop_queue(struct bfin_spi_master_data *drv_data) | |||
| 1284 | * friends on every SPI message. Do this instead | 1284 | * friends on every SPI message. Do this instead |
| 1285 | */ | 1285 | */ |
| 1286 | drv_data->running = false; | 1286 | drv_data->running = false; |
| 1287 | while (!list_empty(&drv_data->queue) && drv_data->busy && limit--) { | 1287 | while ((!list_empty(&drv_data->queue) || drv_data->busy) && limit--) { |
| 1288 | spin_unlock_irqrestore(&drv_data->lock, flags); | 1288 | spin_unlock_irqrestore(&drv_data->lock, flags); |
| 1289 | msleep(10); | 1289 | msleep(10); |
| 1290 | spin_lock_irqsave(&drv_data->lock, flags); | 1290 | spin_lock_irqsave(&drv_data->lock, flags); |
diff --git a/drivers/staging/Kconfig b/drivers/staging/Kconfig index dca4a0bb6ca9..e3786f161bc3 100644 --- a/drivers/staging/Kconfig +++ b/drivers/staging/Kconfig | |||
| @@ -131,8 +131,6 @@ source "drivers/staging/wlags49_h2/Kconfig" | |||
| 131 | 131 | ||
| 132 | source "drivers/staging/wlags49_h25/Kconfig" | 132 | source "drivers/staging/wlags49_h25/Kconfig" |
| 133 | 133 | ||
| 134 | source "drivers/staging/samsung-laptop/Kconfig" | ||
| 135 | |||
| 136 | source "drivers/staging/sm7xx/Kconfig" | 134 | source "drivers/staging/sm7xx/Kconfig" |
| 137 | 135 | ||
| 138 | source "drivers/staging/dt3155v4l/Kconfig" | 136 | source "drivers/staging/dt3155v4l/Kconfig" |
diff --git a/drivers/staging/Makefile b/drivers/staging/Makefile index eb93012b6f59..f0d5c5315612 100644 --- a/drivers/staging/Makefile +++ b/drivers/staging/Makefile | |||
| @@ -48,7 +48,6 @@ obj-$(CONFIG_XVMALLOC) += zram/ | |||
| 48 | obj-$(CONFIG_ZCACHE) += zcache/ | 48 | obj-$(CONFIG_ZCACHE) += zcache/ |
| 49 | obj-$(CONFIG_WLAGS49_H2) += wlags49_h2/ | 49 | obj-$(CONFIG_WLAGS49_H2) += wlags49_h2/ |
| 50 | obj-$(CONFIG_WLAGS49_H25) += wlags49_h25/ | 50 | obj-$(CONFIG_WLAGS49_H25) += wlags49_h25/ |
| 51 | obj-$(CONFIG_SAMSUNG_LAPTOP) += samsung-laptop/ | ||
| 52 | obj-$(CONFIG_FB_SM7XX) += sm7xx/ | 51 | obj-$(CONFIG_FB_SM7XX) += sm7xx/ |
| 53 | obj-$(CONFIG_VIDEO_DT3155) += dt3155v4l/ | 52 | obj-$(CONFIG_VIDEO_DT3155) += dt3155v4l/ |
| 54 | obj-$(CONFIG_CRYSTALHD) += crystalhd/ | 53 | obj-$(CONFIG_CRYSTALHD) += crystalhd/ |
diff --git a/drivers/staging/samsung-laptop/Kconfig b/drivers/staging/samsung-laptop/Kconfig deleted file mode 100644 index f27c60864c26..000000000000 --- a/drivers/staging/samsung-laptop/Kconfig +++ /dev/null | |||
| @@ -1,10 +0,0 @@ | |||
| 1 | config SAMSUNG_LAPTOP | ||
| 2 | tristate "Samsung Laptop driver" | ||
| 3 | default n | ||
| 4 | depends on RFKILL && BACKLIGHT_CLASS_DEVICE && X86 | ||
| 5 | help | ||
| 6 | This module implements a driver for the N128 Samsung Laptop | ||
| 7 | providing control over the Wireless LED and the LCD backlight | ||
| 8 | |||
| 9 | To compile this driver as a module, choose | ||
| 10 | M here: the module will be called samsung-laptop. | ||
diff --git a/drivers/staging/samsung-laptop/Makefile b/drivers/staging/samsung-laptop/Makefile deleted file mode 100644 index 3c6f42045211..000000000000 --- a/drivers/staging/samsung-laptop/Makefile +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | obj-$(CONFIG_SAMSUNG_LAPTOP) += samsung-laptop.o | ||
diff --git a/drivers/staging/samsung-laptop/TODO b/drivers/staging/samsung-laptop/TODO deleted file mode 100644 index f7a6d589916e..000000000000 --- a/drivers/staging/samsung-laptop/TODO +++ /dev/null | |||
| @@ -1,5 +0,0 @@ | |||
| 1 | TODO: | ||
| 2 | - review from other developers | ||
| 3 | - figure out ACPI video issues | ||
| 4 | |||
| 5 | Please send patches to Greg Kroah-Hartman <gregkh@suse.de> | ||
diff --git a/drivers/staging/samsung-laptop/samsung-laptop.c b/drivers/staging/samsung-laptop/samsung-laptop.c deleted file mode 100644 index 25294462b8b6..000000000000 --- a/drivers/staging/samsung-laptop/samsung-laptop.c +++ /dev/null | |||
| @@ -1,843 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Samsung Laptop driver | ||
| 3 | * | ||
| 4 | * Copyright (C) 2009,2011 Greg Kroah-Hartman (gregkh@suse.de) | ||
| 5 | * Copyright (C) 2009,2011 Novell Inc. | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or modify it | ||
| 8 | * under the terms of the GNU General Public License version 2 as published by | ||
| 9 | * the Free Software Foundation. | ||
| 10 | * | ||
| 11 | */ | ||
| 12 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
| 13 | |||
| 14 | #include <linux/kernel.h> | ||
| 15 | #include <linux/init.h> | ||
| 16 | #include <linux/module.h> | ||
| 17 | #include <linux/delay.h> | ||
| 18 | #include <linux/pci.h> | ||
| 19 | #include <linux/backlight.h> | ||
| 20 | #include <linux/fb.h> | ||
| 21 | #include <linux/dmi.h> | ||
| 22 | #include <linux/platform_device.h> | ||
| 23 | #include <linux/rfkill.h> | ||
| 24 | |||
| 25 | /* | ||
| 26 | * This driver is needed because a number of Samsung laptops do not hook | ||
| 27 | * their control settings through ACPI. So we have to poke around in the | ||
| 28 | * BIOS to do things like brightness values, and "special" key controls. | ||
| 29 | */ | ||
| 30 | |||
| 31 | /* | ||
| 32 | * We have 0 - 8 as valid brightness levels. The specs say that level 0 should | ||
| 33 | * be reserved by the BIOS (which really doesn't make much sense), we tell | ||
| 34 | * userspace that the value is 0 - 7 and then just tell the hardware 1 - 8 | ||
| 35 | */ | ||
| 36 | #define MAX_BRIGHT 0x07 | ||
| 37 | |||
| 38 | |||
| 39 | #define SABI_IFACE_MAIN 0x00 | ||
| 40 | #define SABI_IFACE_SUB 0x02 | ||
| 41 | #define SABI_IFACE_COMPLETE 0x04 | ||
| 42 | #define SABI_IFACE_DATA 0x05 | ||
| 43 | |||
| 44 | /* Structure to get data back to the calling function */ | ||
| 45 | struct sabi_retval { | ||
| 46 | u8 retval[20]; | ||
| 47 | }; | ||
| 48 | |||
| 49 | struct sabi_header_offsets { | ||
| 50 | u8 port; | ||
| 51 | u8 re_mem; | ||
| 52 | u8 iface_func; | ||
| 53 | u8 en_mem; | ||
| 54 | u8 data_offset; | ||
| 55 | u8 data_segment; | ||
| 56 | }; | ||
| 57 | |||
| 58 | struct sabi_commands { | ||
| 59 | /* | ||
| 60 | * Brightness is 0 - 8, as described above. | ||
| 61 | * Value 0 is for the BIOS to use | ||
| 62 | */ | ||
| 63 | u8 get_brightness; | ||
| 64 | u8 set_brightness; | ||
| 65 | |||
| 66 | /* | ||
| 67 | * first byte: | ||
| 68 | * 0x00 - wireless is off | ||
| 69 | * 0x01 - wireless is on | ||
| 70 | * second byte: | ||
| 71 | * 0x02 - 3G is off | ||
| 72 | * 0x03 - 3G is on | ||
| 73 | * TODO, verify 3G is correct, that doesn't seem right... | ||
| 74 | */ | ||
| 75 | u8 get_wireless_button; | ||
| 76 | u8 set_wireless_button; | ||
| 77 | |||
| 78 | /* 0 is off, 1 is on */ | ||
| 79 | u8 get_backlight; | ||
| 80 | u8 set_backlight; | ||
| 81 | |||
| 82 | /* | ||
| 83 | * 0x80 or 0x00 - no action | ||
| 84 | * 0x81 - recovery key pressed | ||
| 85 | */ | ||
| 86 | u8 get_recovery_mode; | ||
| 87 | u8 set_recovery_mode; | ||
| 88 | |||
| 89 | /* | ||
| 90 | * on seclinux: 0 is low, 1 is high, | ||
| 91 | * on swsmi: 0 is normal, 1 is silent, 2 is turbo | ||
| 92 | */ | ||
| 93 | u8 get_performance_level; | ||
| 94 | u8 set_performance_level; | ||
| 95 | |||
| 96 | /* | ||
| 97 | * Tell the BIOS that Linux is running on this machine. | ||
| 98 | * 81 is on, 80 is off | ||
| 99 | */ | ||
| 100 | u8 set_linux; | ||
| 101 | }; | ||
| 102 | |||
| 103 | struct sabi_performance_level { | ||
| 104 | const char *name; | ||
| 105 | u8 value; | ||
| 106 | }; | ||
| 107 | |||
| 108 | struct sabi_config { | ||
| 109 | const char *test_string; | ||
| 110 | u16 main_function; | ||
| 111 | const struct sabi_header_offsets header_offsets; | ||
| 112 | const struct sabi_commands commands; | ||
| 113 | const struct sabi_performance_level performance_levels[4]; | ||
| 114 | u8 min_brightness; | ||
| 115 | u8 max_brightness; | ||
| 116 | }; | ||
| 117 | |||
| 118 | static const struct sabi_config sabi_configs[] = { | ||
| 119 | { | ||
| 120 | .test_string = "SECLINUX", | ||
| 121 | |||
| 122 | .main_function = 0x4c49, | ||
| 123 | |||
| 124 | .header_offsets = { | ||
| 125 | .port = 0x00, | ||
| 126 | .re_mem = 0x02, | ||
| 127 | .iface_func = 0x03, | ||
| 128 | .en_mem = 0x04, | ||
| 129 | .data_offset = 0x05, | ||
| 130 | .data_segment = 0x07, | ||
| 131 | }, | ||
| 132 | |||
| 133 | .commands = { | ||
| 134 | .get_brightness = 0x00, | ||
| 135 | .set_brightness = 0x01, | ||
| 136 | |||
| 137 | .get_wireless_button = 0x02, | ||
| 138 | .set_wireless_button = 0x03, | ||
| 139 | |||
| 140 | .get_backlight = 0x04, | ||
| 141 | .set_backlight = 0x05, | ||
| 142 | |||
| 143 | .get_recovery_mode = 0x06, | ||
| 144 | .set_recovery_mode = 0x07, | ||
| 145 | |||
| 146 | .get_performance_level = 0x08, | ||
| 147 | .set_performance_level = 0x09, | ||
| 148 | |||
| 149 | .set_linux = 0x0a, | ||
| 150 | }, | ||
| 151 | |||
| 152 | .performance_levels = { | ||
| 153 | { | ||
| 154 | .name = "silent", | ||
| 155 | .value = 0, | ||
| 156 | }, | ||
| 157 | { | ||
| 158 | .name = "normal", | ||
| 159 | .value = 1, | ||
| 160 | }, | ||
| 161 | { }, | ||
| 162 | }, | ||
| 163 | .min_brightness = 1, | ||
| 164 | .max_brightness = 8, | ||
| 165 | }, | ||
| 166 | { | ||
| 167 | .test_string = "SwSmi@", | ||
| 168 | |||
| 169 | .main_function = 0x5843, | ||
| 170 | |||
| 171 | .header_offsets = { | ||
| 172 | .port = 0x00, | ||
| 173 | .re_mem = 0x04, | ||
| 174 | .iface_func = 0x02, | ||
| 175 | .en_mem = 0x03, | ||
| 176 | .data_offset = 0x05, | ||
| 177 | .data_segment = 0x07, | ||
| 178 | }, | ||
| 179 | |||
| 180 | .commands = { | ||
| 181 | .get_brightness = 0x10, | ||
| 182 | .set_brightness = 0x11, | ||
| 183 | |||
| 184 | .get_wireless_button = 0x12, | ||
| 185 | .set_wireless_button = 0x13, | ||
| 186 | |||
| 187 | .get_backlight = 0x2d, | ||
| 188 | .set_backlight = 0x2e, | ||
| 189 | |||
| 190 | .get_recovery_mode = 0xff, | ||
| 191 | .set_recovery_mode = 0xff, | ||
| 192 | |||
| 193 | .get_performance_level = 0x31, | ||
| 194 | .set_performance_level = 0x32, | ||
| 195 | |||
| 196 | .set_linux = 0xff, | ||
| 197 | }, | ||
| 198 | |||
| 199 | .performance_levels = { | ||
| 200 | { | ||
| 201 | .name = "normal", | ||
| 202 | .value = 0, | ||
| 203 | }, | ||
| 204 | { | ||
| 205 | .name = "silent", | ||
| 206 | .value = 1, | ||
| 207 | }, | ||
| 208 | { | ||
| 209 | .name = "overclock", | ||
| 210 | .value = 2, | ||
| 211 | }, | ||
| 212 | { }, | ||
| 213 | }, | ||
| 214 | .min_brightness = 0, | ||
| 215 | .max_brightness = 8, | ||
| 216 | }, | ||
| 217 | { }, | ||
| 218 | }; | ||
| 219 | |||
| 220 | static const struct sabi_config *sabi_config; | ||
| 221 | |||
| 222 | static void __iomem *sabi; | ||
| 223 | static void __iomem *sabi_iface; | ||
| 224 | static void __iomem *f0000_segment; | ||
| 225 | static struct backlight_device *backlight_device; | ||
| 226 | static struct mutex sabi_mutex; | ||
| 227 | static struct platform_device *sdev; | ||
| 228 | static struct rfkill *rfk; | ||
| 229 | |||
| 230 | static int force; | ||
| 231 | module_param(force, bool, 0); | ||
| 232 | MODULE_PARM_DESC(force, | ||
| 233 | "Disable the DMI check and forces the driver to be loaded"); | ||
| 234 | |||
| 235 | static int debug; | ||
| 236 | module_param(debug, bool, S_IRUGO | S_IWUSR); | ||
| 237 | MODULE_PARM_DESC(debug, "Debug enabled or not"); | ||
| 238 | |||
| 239 | static int sabi_get_command(u8 command, struct sabi_retval *sretval) | ||
| 240 | { | ||
| 241 | int retval = 0; | ||
| 242 | u16 port = readw(sabi + sabi_config->header_offsets.port); | ||
| 243 | u8 complete, iface_data; | ||
| 244 | |||
| 245 | mutex_lock(&sabi_mutex); | ||
| 246 | |||
| 247 | /* enable memory to be able to write to it */ | ||
| 248 | outb(readb(sabi + sabi_config->header_offsets.en_mem), port); | ||
| 249 | |||
| 250 | /* write out the command */ | ||
| 251 | writew(sabi_config->main_function, sabi_iface + SABI_IFACE_MAIN); | ||
| 252 | writew(command, sabi_iface + SABI_IFACE_SUB); | ||
| 253 | writeb(0, sabi_iface + SABI_IFACE_COMPLETE); | ||
| 254 | outb(readb(sabi + sabi_config->header_offsets.iface_func), port); | ||
| 255 | |||
| 256 | /* write protect memory to make it safe */ | ||
| 257 | outb(readb(sabi + sabi_config->header_offsets.re_mem), port); | ||
| 258 | |||
| 259 | /* see if the command actually succeeded */ | ||
| 260 | complete = readb(sabi_iface + SABI_IFACE_COMPLETE); | ||
| 261 | iface_data = readb(sabi_iface + SABI_IFACE_DATA); | ||
| 262 | if (complete != 0xaa || iface_data == 0xff) { | ||
| 263 | pr_warn("SABI get command 0x%02x failed with completion flag 0x%02x and data 0x%02x\n", | ||
| 264 | command, complete, iface_data); | ||
| 265 | retval = -EINVAL; | ||
| 266 | goto exit; | ||
| 267 | } | ||
| 268 | /* | ||
| 269 | * Save off the data into a structure so the caller use it. | ||
| 270 | * Right now we only want the first 4 bytes, | ||
| 271 | * There are commands that need more, but not for the ones we | ||
| 272 | * currently care about. | ||
| 273 | */ | ||
| 274 | sretval->retval[0] = readb(sabi_iface + SABI_IFACE_DATA); | ||
| 275 | sretval->retval[1] = readb(sabi_iface + SABI_IFACE_DATA + 1); | ||
| 276 | sretval->retval[2] = readb(sabi_iface + SABI_IFACE_DATA + 2); | ||
| 277 | sretval->retval[3] = readb(sabi_iface + SABI_IFACE_DATA + 3); | ||
| 278 | |||
| 279 | exit: | ||
| 280 | mutex_unlock(&sabi_mutex); | ||
| 281 | return retval; | ||
| 282 | |||
| 283 | } | ||
| 284 | |||
| 285 | static int sabi_set_command(u8 command, u8 data) | ||
| 286 | { | ||
| 287 | int retval = 0; | ||
| 288 | u16 port = readw(sabi + sabi_config->header_offsets.port); | ||
| 289 | u8 complete, iface_data; | ||
| 290 | |||
| 291 | mutex_lock(&sabi_mutex); | ||
| 292 | |||
| 293 | /* enable memory to be able to write to it */ | ||
| 294 | outb(readb(sabi + sabi_config->header_offsets.en_mem), port); | ||
| 295 | |||
| 296 | /* write out the command */ | ||
| 297 | writew(sabi_config->main_function, sabi_iface + SABI_IFACE_MAIN); | ||
| 298 | writew(command, sabi_iface + SABI_IFACE_SUB); | ||
| 299 | writeb(0, sabi_iface + SABI_IFACE_COMPLETE); | ||
| 300 | writeb(data, sabi_iface + SABI_IFACE_DATA); | ||
| 301 | outb(readb(sabi + sabi_config->header_offsets.iface_func), port); | ||
| 302 | |||
| 303 | /* write protect memory to make it safe */ | ||
| 304 | outb(readb(sabi + sabi_config->header_offsets.re_mem), port); | ||
| 305 | |||
| 306 | /* see if the command actually succeeded */ | ||
| 307 | complete = readb(sabi_iface + SABI_IFACE_COMPLETE); | ||
| 308 | iface_data = readb(sabi_iface + SABI_IFACE_DATA); | ||
| 309 | if (complete != 0xaa || iface_data == 0xff) { | ||
| 310 | pr_warn("SABI set command 0x%02x failed with completion flag 0x%02x and data 0x%02x\n", | ||
| 311 | command, complete, iface_data); | ||
| 312 | retval = -EINVAL; | ||
| 313 | } | ||
| 314 | |||
| 315 | mutex_unlock(&sabi_mutex); | ||
| 316 | return retval; | ||
| 317 | } | ||
| 318 | |||
| 319 | static void test_backlight(void) | ||
| 320 | { | ||
| 321 | struct sabi_retval sretval; | ||
| 322 | |||
| 323 | sabi_get_command(sabi_config->commands.get_backlight, &sretval); | ||
| 324 | printk(KERN_DEBUG "backlight = 0x%02x\n", sretval.retval[0]); | ||
| 325 | |||
| 326 | sabi_set_command(sabi_config->commands.set_backlight, 0); | ||
| 327 | printk(KERN_DEBUG "backlight should be off\n"); | ||
| 328 | |||
| 329 | sabi_get_command(sabi_config->commands.get_backlight, &sretval); | ||
| 330 | printk(KERN_DEBUG "backlight = 0x%02x\n", sretval.retval[0]); | ||
| 331 | |||
| 332 | msleep(1000); | ||
| 333 | |||
| 334 | sabi_set_command(sabi_config->commands.set_backlight, 1); | ||
| 335 | printk(KERN_DEBUG "backlight should be on\n"); | ||
| 336 | |||
| 337 | sabi_get_command(sabi_config->commands.get_backlight, &sretval); | ||
| 338 | printk(KERN_DEBUG "backlight = 0x%02x\n", sretval.retval[0]); | ||
| 339 | } | ||
| 340 | |||
| 341 | static void test_wireless(void) | ||
| 342 | { | ||
| 343 | struct sabi_retval sretval; | ||
| 344 | |||
| 345 | sabi_get_command(sabi_config->commands.get_wireless_button, &sretval); | ||
| 346 | printk(KERN_DEBUG "wireless led = 0x%02x\n", sretval.retval[0]); | ||
| 347 | |||
| 348 | sabi_set_command(sabi_config->commands.set_wireless_button, 0); | ||
| 349 | printk(KERN_DEBUG "wireless led should be off\n"); | ||
| 350 | |||
| 351 | sabi_get_command(sabi_config->commands.get_wireless_button, &sretval); | ||
| 352 | printk(KERN_DEBUG "wireless led = 0x%02x\n", sretval.retval[0]); | ||
| 353 | |||
| 354 | msleep(1000); | ||
| 355 | |||
| 356 | sabi_set_command(sabi_config->commands.set_wireless_button, 1); | ||
| 357 | printk(KERN_DEBUG "wireless led should be on\n"); | ||
| 358 | |||
| 359 | sabi_get_command(sabi_config->commands.get_wireless_button, &sretval); | ||
| 360 | printk(KERN_DEBUG "wireless led = 0x%02x\n", sretval.retval[0]); | ||
| 361 | } | ||
| 362 | |||
| 363 | static u8 read_brightness(void) | ||
| 364 | { | ||
| 365 | struct sabi_retval sretval; | ||
| 366 | int user_brightness = 0; | ||
| 367 | int retval; | ||
| 368 | |||
| 369 | retval = sabi_get_command(sabi_config->commands.get_brightness, | ||
| 370 | &sretval); | ||
| 371 | if (!retval) { | ||
| 372 | user_brightness = sretval.retval[0]; | ||
| 373 | if (user_brightness != 0) | ||
| 374 | user_brightness -= sabi_config->min_brightness; | ||
| 375 | } | ||
| 376 | return user_brightness; | ||
| 377 | } | ||
| 378 | |||
| 379 | static void set_brightness(u8 user_brightness) | ||
| 380 | { | ||
| 381 | u8 user_level = user_brightness - sabi_config->min_brightness; | ||
| 382 | |||
| 383 | sabi_set_command(sabi_config->commands.set_brightness, user_level); | ||
| 384 | } | ||
| 385 | |||
| 386 | static int get_brightness(struct backlight_device *bd) | ||
| 387 | { | ||
| 388 | return (int)read_brightness(); | ||
| 389 | } | ||
| 390 | |||
| 391 | static int update_status(struct backlight_device *bd) | ||
| 392 | { | ||
| 393 | set_brightness(bd->props.brightness); | ||
| 394 | |||
| 395 | if (bd->props.power == FB_BLANK_UNBLANK) | ||
| 396 | sabi_set_command(sabi_config->commands.set_backlight, 1); | ||
| 397 | else | ||
| 398 | sabi_set_command(sabi_config->commands.set_backlight, 0); | ||
| 399 | return 0; | ||
| 400 | } | ||
| 401 | |||
| 402 | static const struct backlight_ops backlight_ops = { | ||
| 403 | .get_brightness = get_brightness, | ||
| 404 | .update_status = update_status, | ||
| 405 | }; | ||
| 406 | |||
| 407 | static int rfkill_set(void *data, bool blocked) | ||
| 408 | { | ||
| 409 | /* Do something with blocked...*/ | ||
| 410 | /* | ||
| 411 | * blocked == false is on | ||
| 412 | * blocked == true is off | ||
| 413 | */ | ||
| 414 | if (blocked) | ||
| 415 | sabi_set_command(sabi_config->commands.set_wireless_button, 0); | ||
| 416 | else | ||
| 417 | sabi_set_command(sabi_config->commands.set_wireless_button, 1); | ||
| 418 | |||
| 419 | return 0; | ||
| 420 | } | ||
| 421 | |||
| 422 | static struct rfkill_ops rfkill_ops = { | ||
| 423 | .set_block = rfkill_set, | ||
| 424 | }; | ||
| 425 | |||
| 426 | static int init_wireless(struct platform_device *sdev) | ||
| 427 | { | ||
| 428 | int retval; | ||
| 429 | |||
| 430 | rfk = rfkill_alloc("samsung-wifi", &sdev->dev, RFKILL_TYPE_WLAN, | ||
| 431 | &rfkill_ops, NULL); | ||
| 432 | if (!rfk) | ||
| 433 | return -ENOMEM; | ||
| 434 | |||
| 435 | retval = rfkill_register(rfk); | ||
| 436 | if (retval) { | ||
| 437 | rfkill_destroy(rfk); | ||
| 438 | return -ENODEV; | ||
| 439 | } | ||
| 440 | |||
| 441 | return 0; | ||
| 442 | } | ||
| 443 | |||
| 444 | static void destroy_wireless(void) | ||
| 445 | { | ||
| 446 | rfkill_unregister(rfk); | ||
| 447 | rfkill_destroy(rfk); | ||
| 448 | } | ||
| 449 | |||
| 450 | static ssize_t get_performance_level(struct device *dev, | ||
| 451 | struct device_attribute *attr, char *buf) | ||
| 452 | { | ||
| 453 | struct sabi_retval sretval; | ||
| 454 | int retval; | ||
| 455 | int i; | ||
| 456 | |||
| 457 | /* Read the state */ | ||
| 458 | retval = sabi_get_command(sabi_config->commands.get_performance_level, | ||
| 459 | &sretval); | ||
| 460 | if (retval) | ||
| 461 | return retval; | ||
| 462 | |||
| 463 | /* The logic is backwards, yeah, lots of fun... */ | ||
| 464 | for (i = 0; sabi_config->performance_levels[i].name; ++i) { | ||
| 465 | if (sretval.retval[0] == sabi_config->performance_levels[i].value) | ||
| 466 | return sprintf(buf, "%s\n", sabi_config->performance_levels[i].name); | ||
| 467 | } | ||
| 468 | return sprintf(buf, "%s\n", "unknown"); | ||
| 469 | } | ||
| 470 | |||
| 471 | static ssize_t set_performance_level(struct device *dev, | ||
| 472 | struct device_attribute *attr, const char *buf, | ||
| 473 | size_t count) | ||
| 474 | { | ||
| 475 | if (count >= 1) { | ||
| 476 | int i; | ||
| 477 | for (i = 0; sabi_config->performance_levels[i].name; ++i) { | ||
| 478 | const struct sabi_performance_level *level = | ||
| 479 | &sabi_config->performance_levels[i]; | ||
| 480 | if (!strncasecmp(level->name, buf, strlen(level->name))) { | ||
| 481 | sabi_set_command(sabi_config->commands.set_performance_level, | ||
| 482 | level->value); | ||
| 483 | break; | ||
| 484 | } | ||
| 485 | } | ||
| 486 | if (!sabi_config->performance_levels[i].name) | ||
| 487 | return -EINVAL; | ||
| 488 | } | ||
| 489 | return count; | ||
| 490 | } | ||
| 491 | static DEVICE_ATTR(performance_level, S_IWUSR | S_IRUGO, | ||
| 492 | get_performance_level, set_performance_level); | ||
| 493 | |||
| 494 | |||
| 495 | static int __init dmi_check_cb(const struct dmi_system_id *id) | ||
| 496 | { | ||
| 497 | pr_info("found laptop model '%s'\n", | ||
| 498 | id->ident); | ||
| 499 | return 0; | ||
| 500 | } | ||
| 501 | |||
| 502 | static struct dmi_system_id __initdata samsung_dmi_table[] = { | ||
| 503 | { | ||
| 504 | .ident = "N128", | ||
| 505 | .matches = { | ||
| 506 | DMI_MATCH(DMI_SYS_VENDOR, | ||
| 507 | "SAMSUNG ELECTRONICS CO., LTD."), | ||
| 508 | DMI_MATCH(DMI_PRODUCT_NAME, "N128"), | ||
| 509 | DMI_MATCH(DMI_BOARD_NAME, "N128"), | ||
| 510 | }, | ||
| 511 | .callback = dmi_check_cb, | ||
| 512 | }, | ||
| 513 | { | ||
| 514 | .ident = "N130", | ||
| 515 | .matches = { | ||
| 516 | DMI_MATCH(DMI_SYS_VENDOR, | ||
| 517 | "SAMSUNG ELECTRONICS CO., LTD."), | ||
| 518 | DMI_MATCH(DMI_PRODUCT_NAME, "N130"), | ||
| 519 | DMI_MATCH(DMI_BOARD_NAME, "N130"), | ||
| 520 | }, | ||
| 521 | .callback = dmi_check_cb, | ||
| 522 | }, | ||
| 523 | { | ||
| 524 | .ident = "X125", | ||
| 525 | .matches = { | ||
| 526 | DMI_MATCH(DMI_SYS_VENDOR, | ||
| 527 | "SAMSUNG ELECTRONICS CO., LTD."), | ||
| 528 | DMI_MATCH(DMI_PRODUCT_NAME, "X125"), | ||
| 529 | DMI_MATCH(DMI_BOARD_NAME, "X125"), | ||
| 530 | }, | ||
| 531 | .callback = dmi_check_cb, | ||
| 532 | }, | ||
| 533 | { | ||
| 534 | .ident = "X120/X170", | ||
| 535 | .matches = { | ||
| 536 | DMI_MATCH(DMI_SYS_VENDOR, | ||
| 537 | "SAMSUNG ELECTRONICS CO., LTD."), | ||
| 538 | DMI_MATCH(DMI_PRODUCT_NAME, "X120/X170"), | ||
| 539 | DMI_MATCH(DMI_BOARD_NAME, "X120/X170"), | ||
| 540 | }, | ||
| 541 | .callback = dmi_check_cb, | ||
| 542 | }, | ||
| 543 | { | ||
| 544 | .ident = "NC10", | ||
| 545 | .matches = { | ||
| 546 | DMI_MATCH(DMI_SYS_VENDOR, | ||
| 547 | "SAMSUNG ELECTRONICS CO., LTD."), | ||
| 548 | DMI_MATCH(DMI_PRODUCT_NAME, "NC10"), | ||
| 549 | DMI_MATCH(DMI_BOARD_NAME, "NC10"), | ||
| 550 | }, | ||
| 551 | .callback = dmi_check_cb, | ||
| 552 | }, | ||
| 553 | { | ||
| 554 | .ident = "NP-Q45", | ||
| 555 | .matches = { | ||
| 556 | DMI_MATCH(DMI_SYS_VENDOR, | ||
| 557 | "SAMSUNG ELECTRONICS CO., LTD."), | ||
| 558 | DMI_MATCH(DMI_PRODUCT_NAME, "SQ45S70S"), | ||
| 559 | DMI_MATCH(DMI_BOARD_NAME, "SQ45S70S"), | ||
| 560 | }, | ||
| 561 | .callback = dmi_check_cb, | ||
| 562 | }, | ||
| 563 | { | ||
| 564 | .ident = "X360", | ||
| 565 | .matches = { | ||
| 566 | DMI_MATCH(DMI_SYS_VENDOR, | ||
| 567 | "SAMSUNG ELECTRONICS CO., LTD."), | ||
| 568 | DMI_MATCH(DMI_PRODUCT_NAME, "X360"), | ||
| 569 | DMI_MATCH(DMI_BOARD_NAME, "X360"), | ||
| 570 | }, | ||
| 571 | .callback = dmi_check_cb, | ||
| 572 | }, | ||
| 573 | { | ||
| 574 | .ident = "R410 Plus", | ||
| 575 | .matches = { | ||
| 576 | DMI_MATCH(DMI_SYS_VENDOR, | ||
| 577 | "SAMSUNG ELECTRONICS CO., LTD."), | ||
| 578 | DMI_MATCH(DMI_PRODUCT_NAME, "R410P"), | ||
| 579 | DMI_MATCH(DMI_BOARD_NAME, "R460"), | ||
| 580 | }, | ||
| 581 | .callback = dmi_check_cb, | ||
| 582 | }, | ||
| 583 | { | ||
| 584 | .ident = "R518", | ||
| 585 | .matches = { | ||
| 586 | DMI_MATCH(DMI_SYS_VENDOR, | ||
| 587 | "SAMSUNG ELECTRONICS CO., LTD."), | ||
| 588 | DMI_MATCH(DMI_PRODUCT_NAME, "R518"), | ||
| 589 | DMI_MATCH(DMI_BOARD_NAME, "R518"), | ||
| 590 | }, | ||
| 591 | .callback = dmi_check_cb, | ||
| 592 | }, | ||
| 593 | { | ||
| 594 | .ident = "R519/R719", | ||
| 595 | .matches = { | ||
| 596 | DMI_MATCH(DMI_SYS_VENDOR, | ||
| 597 | "SAMSUNG ELECTRONICS CO., LTD."), | ||
| 598 | DMI_MATCH(DMI_PRODUCT_NAME, "R519/R719"), | ||
| 599 | DMI_MATCH(DMI_BOARD_NAME, "R519/R719"), | ||
| 600 | }, | ||
| 601 | .callback = dmi_check_cb, | ||
| 602 | }, | ||
| 603 | { | ||
| 604 | .ident = "N150/N210/N220/N230", | ||
| 605 | .matches = { | ||
| 606 | DMI_MATCH(DMI_SYS_VENDOR, | ||
| 607 | "SAMSUNG ELECTRONICS CO., LTD."), | ||
| 608 | DMI_MATCH(DMI_PRODUCT_NAME, "N150/N210/N220/N230"), | ||
| 609 | DMI_MATCH(DMI_BOARD_NAME, "N150/N210/N220/N230"), | ||
| 610 | }, | ||
| 611 | .callback = dmi_check_cb, | ||
| 612 | }, | ||
| 613 | { | ||
| 614 | .ident = "N150P/N210P/N220P", | ||
| 615 | .matches = { | ||
| 616 | DMI_MATCH(DMI_SYS_VENDOR, | ||
| 617 | "SAMSUNG ELECTRONICS CO., LTD."), | ||
| 618 | DMI_MATCH(DMI_PRODUCT_NAME, "N150P/N210P/N220P"), | ||
| 619 | DMI_MATCH(DMI_BOARD_NAME, "N150P/N210P/N220P"), | ||
| 620 | }, | ||
| 621 | .callback = dmi_check_cb, | ||
| 622 | }, | ||
| 623 | { | ||
| 624 | .ident = "R530/R730", | ||
| 625 | .matches = { | ||
| 626 | DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."), | ||
| 627 | DMI_MATCH(DMI_PRODUCT_NAME, "R530/R730"), | ||
| 628 | DMI_MATCH(DMI_BOARD_NAME, "R530/R730"), | ||
| 629 | }, | ||
| 630 | .callback = dmi_check_cb, | ||
| 631 | }, | ||
| 632 | { | ||
| 633 | .ident = "NF110/NF210/NF310", | ||
| 634 | .matches = { | ||
| 635 | DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."), | ||
| 636 | DMI_MATCH(DMI_PRODUCT_NAME, "NF110/NF210/NF310"), | ||
| 637 | DMI_MATCH(DMI_BOARD_NAME, "NF110/NF210/NF310"), | ||
| 638 | }, | ||
| 639 | .callback = dmi_check_cb, | ||
| 640 | }, | ||
| 641 | { | ||
| 642 | .ident = "N145P/N250P/N260P", | ||
| 643 | .matches = { | ||
| 644 | DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."), | ||
| 645 | DMI_MATCH(DMI_PRODUCT_NAME, "N145P/N250P/N260P"), | ||
| 646 | DMI_MATCH(DMI_BOARD_NAME, "N145P/N250P/N260P"), | ||
| 647 | }, | ||
| 648 | .callback = dmi_check_cb, | ||
| 649 | }, | ||
| 650 | { | ||
| 651 | .ident = "R70/R71", | ||
| 652 | .matches = { | ||
| 653 | DMI_MATCH(DMI_SYS_VENDOR, | ||
| 654 | "SAMSUNG ELECTRONICS CO., LTD."), | ||
| 655 | DMI_MATCH(DMI_PRODUCT_NAME, "R70/R71"), | ||
| 656 | DMI_MATCH(DMI_BOARD_NAME, "R70/R71"), | ||
| 657 | }, | ||
| 658 | .callback = dmi_check_cb, | ||
| 659 | }, | ||
| 660 | { | ||
| 661 | .ident = "P460", | ||
| 662 | .matches = { | ||
| 663 | DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."), | ||
| 664 | DMI_MATCH(DMI_PRODUCT_NAME, "P460"), | ||
| 665 | DMI_MATCH(DMI_BOARD_NAME, "P460"), | ||
| 666 | }, | ||
| 667 | .callback = dmi_check_cb, | ||
| 668 | }, | ||
| 669 | { }, | ||
| 670 | }; | ||
| 671 | MODULE_DEVICE_TABLE(dmi, samsung_dmi_table); | ||
| 672 | |||
| 673 | static int find_signature(void __iomem *memcheck, const char *testStr) | ||
| 674 | { | ||
| 675 | int i = 0; | ||
| 676 | int loca; | ||
| 677 | |||
| 678 | for (loca = 0; loca < 0xffff; loca++) { | ||
| 679 | char temp = readb(memcheck + loca); | ||
| 680 | |||
| 681 | if (temp == testStr[i]) { | ||
| 682 | if (i == strlen(testStr)-1) | ||
| 683 | break; | ||
| 684 | ++i; | ||
| 685 | } else { | ||
| 686 | i = 0; | ||
| 687 | } | ||
| 688 | } | ||
| 689 | return loca; | ||
| 690 | } | ||
| 691 | |||
| 692 | static int __init samsung_init(void) | ||
| 693 | { | ||
| 694 | struct backlight_properties props; | ||
| 695 | struct sabi_retval sretval; | ||
| 696 | unsigned int ifaceP; | ||
| 697 | int i; | ||
| 698 | int loca; | ||
| 699 | int retval; | ||
| 700 | |||
| 701 | mutex_init(&sabi_mutex); | ||
| 702 | |||
| 703 | if (!force && !dmi_check_system(samsung_dmi_table)) | ||
| 704 | return -ENODEV; | ||
| 705 | |||
| 706 | f0000_segment = ioremap_nocache(0xf0000, 0xffff); | ||
| 707 | if (!f0000_segment) { | ||
| 708 | pr_err("Can't map the segment at 0xf0000\n"); | ||
| 709 | return -EINVAL; | ||
| 710 | } | ||
| 711 | |||
| 712 | /* Try to find one of the signatures in memory to find the header */ | ||
| 713 | for (i = 0; sabi_configs[i].test_string != 0; ++i) { | ||
| 714 | sabi_config = &sabi_configs[i]; | ||
| 715 | loca = find_signature(f0000_segment, sabi_config->test_string); | ||
| 716 | if (loca != 0xffff) | ||
| 717 | break; | ||
| 718 | } | ||
| 719 | |||
| 720 | if (loca == 0xffff) { | ||
| 721 | pr_err("This computer does not support SABI\n"); | ||
| 722 | goto error_no_signature; | ||
| 723 | } | ||
| 724 | |||
| 725 | /* point to the SMI port Number */ | ||
| 726 | loca += 1; | ||
| 727 | sabi = (f0000_segment + loca); | ||
| 728 | |||
| 729 | if (debug) { | ||
| 730 | printk(KERN_DEBUG "This computer supports SABI==%x\n", | ||
| 731 | loca + 0xf0000 - 6); | ||
| 732 | printk(KERN_DEBUG "SABI header:\n"); | ||
| 733 | printk(KERN_DEBUG " SMI Port Number = 0x%04x\n", | ||
| 734 | readw(sabi + sabi_config->header_offsets.port)); | ||
| 735 | printk(KERN_DEBUG " SMI Interface Function = 0x%02x\n", | ||
| 736 | readb(sabi + sabi_config->header_offsets.iface_func)); | ||
| 737 | printk(KERN_DEBUG " SMI enable memory buffer = 0x%02x\n", | ||
| 738 | readb(sabi + sabi_config->header_offsets.en_mem)); | ||
| 739 | printk(KERN_DEBUG " SMI restore memory buffer = 0x%02x\n", | ||
| 740 | readb(sabi + sabi_config->header_offsets.re_mem)); | ||
| 741 | printk(KERN_DEBUG " SABI data offset = 0x%04x\n", | ||
| 742 | readw(sabi + sabi_config->header_offsets.data_offset)); | ||
| 743 | printk(KERN_DEBUG " SABI data segment = 0x%04x\n", | ||
| 744 | readw(sabi + sabi_config->header_offsets.data_segment)); | ||
| 745 | } | ||
| 746 | |||
| 747 | /* Get a pointer to the SABI Interface */ | ||
| 748 | ifaceP = (readw(sabi + sabi_config->header_offsets.data_segment) & 0x0ffff) << 4; | ||
| 749 | ifaceP += readw(sabi + sabi_config->header_offsets.data_offset) & 0x0ffff; | ||
| 750 | sabi_iface = ioremap_nocache(ifaceP, 16); | ||
| 751 | if (!sabi_iface) { | ||
| 752 | pr_err("Can't remap %x\n", ifaceP); | ||
| 753 | goto exit; | ||
| 754 | } | ||
| 755 | if (debug) { | ||
| 756 | printk(KERN_DEBUG "ifaceP = 0x%08x\n", ifaceP); | ||
| 757 | printk(KERN_DEBUG "sabi_iface = %p\n", sabi_iface); | ||
| 758 | |||
| 759 | test_backlight(); | ||
| 760 | test_wireless(); | ||
| 761 | |||
| 762 | retval = sabi_get_command(sabi_config->commands.get_brightness, | ||
| 763 | &sretval); | ||
| 764 | printk(KERN_DEBUG "brightness = 0x%02x\n", sretval.retval[0]); | ||
| 765 | } | ||
| 766 | |||
| 767 | /* Turn on "Linux" mode in the BIOS */ | ||
| 768 | if (sabi_config->commands.set_linux != 0xff) { | ||
| 769 | retval = sabi_set_command(sabi_config->commands.set_linux, | ||
| 770 | 0x81); | ||
| 771 | if (retval) { | ||
| 772 | pr_warn("Linux mode was not set!\n"); | ||
| 773 | goto error_no_platform; | ||
| 774 | } | ||
| 775 | } | ||
| 776 | |||
| 777 | /* knock up a platform device to hang stuff off of */ | ||
| 778 | sdev = platform_device_register_simple("samsung", -1, NULL, 0); | ||
| 779 | if (IS_ERR(sdev)) | ||
| 780 | goto error_no_platform; | ||
| 781 | |||
| 782 | /* create a backlight device to talk to this one */ | ||
| 783 | memset(&props, 0, sizeof(struct backlight_properties)); | ||
| 784 | props.type = BACKLIGHT_PLATFORM; | ||
| 785 | props.max_brightness = sabi_config->max_brightness; | ||
| 786 | backlight_device = backlight_device_register("samsung", &sdev->dev, | ||
| 787 | NULL, &backlight_ops, | ||
| 788 | &props); | ||
| 789 | if (IS_ERR(backlight_device)) | ||
| 790 | goto error_no_backlight; | ||
| 791 | |||
| 792 | backlight_device->props.brightness = read_brightness(); | ||
| 793 | backlight_device->props.power = FB_BLANK_UNBLANK; | ||
| 794 | backlight_update_status(backlight_device); | ||
| 795 | |||
| 796 | retval = init_wireless(sdev); | ||
| 797 | if (retval) | ||
| 798 | goto error_no_rfk; | ||
| 799 | |||
| 800 | retval = device_create_file(&sdev->dev, &dev_attr_performance_level); | ||
| 801 | if (retval) | ||
| 802 | goto error_file_create; | ||
| 803 | |||
| 804 | exit: | ||
| 805 | return 0; | ||
| 806 | |||
| 807 | error_file_create: | ||
| 808 | destroy_wireless(); | ||
| 809 | |||
| 810 | error_no_rfk: | ||
| 811 | backlight_device_unregister(backlight_device); | ||
| 812 | |||
| 813 | error_no_backlight: | ||
| 814 | platform_device_unregister(sdev); | ||
| 815 | |||
| 816 | error_no_platform: | ||
| 817 | iounmap(sabi_iface); | ||
| 818 | |||
| 819 | error_no_signature: | ||
| 820 | iounmap(f0000_segment); | ||
| 821 | return -EINVAL; | ||
| 822 | } | ||
| 823 | |||
| 824 | static void __exit samsung_exit(void) | ||
| 825 | { | ||
| 826 | /* Turn off "Linux" mode in the BIOS */ | ||
| 827 | if (sabi_config->commands.set_linux != 0xff) | ||
| 828 | sabi_set_command(sabi_config->commands.set_linux, 0x80); | ||
| 829 | |||
| 830 | device_remove_file(&sdev->dev, &dev_attr_performance_level); | ||
| 831 | backlight_device_unregister(backlight_device); | ||
| 832 | destroy_wireless(); | ||
| 833 | iounmap(sabi_iface); | ||
| 834 | iounmap(f0000_segment); | ||
| 835 | platform_device_unregister(sdev); | ||
| 836 | } | ||
| 837 | |||
| 838 | module_init(samsung_init); | ||
| 839 | module_exit(samsung_exit); | ||
| 840 | |||
| 841 | MODULE_AUTHOR("Greg Kroah-Hartman <gregkh@suse.de>"); | ||
| 842 | MODULE_DESCRIPTION("Samsung Backlight driver"); | ||
| 843 | MODULE_LICENSE("GPL"); | ||
diff --git a/drivers/video/pxafb.c b/drivers/video/pxafb.c index a2e5b5100ab4..0f4e8c942f9e 100644 --- a/drivers/video/pxafb.c +++ b/drivers/video/pxafb.c | |||
| @@ -1648,7 +1648,9 @@ pxafb_freq_transition(struct notifier_block *nb, unsigned long val, void *data) | |||
| 1648 | 1648 | ||
| 1649 | switch (val) { | 1649 | switch (val) { |
| 1650 | case CPUFREQ_PRECHANGE: | 1650 | case CPUFREQ_PRECHANGE: |
| 1651 | if (!fbi->overlay[0].usage && !fbi->overlay[1].usage) | 1651 | #ifdef CONFIG_FB_PXA_OVERLAY |
| 1652 | if (!(fbi->overlay[0].usage || fbi->overlay[1].usage)) | ||
| 1653 | #endif | ||
| 1652 | set_ctrlr_state(fbi, C_DISABLE_CLKCHANGE); | 1654 | set_ctrlr_state(fbi, C_DISABLE_CLKCHANGE); |
| 1653 | break; | 1655 | break; |
| 1654 | 1656 | ||
diff --git a/drivers/xen/events.c b/drivers/xen/events.c index 42d6c930cc87..33167b43ac7e 100644 --- a/drivers/xen/events.c +++ b/drivers/xen/events.c | |||
| @@ -912,8 +912,7 @@ int bind_evtchn_to_irqhandler(unsigned int evtchn, | |||
| 912 | unsigned long irqflags, | 912 | unsigned long irqflags, |
| 913 | const char *devname, void *dev_id) | 913 | const char *devname, void *dev_id) |
| 914 | { | 914 | { |
| 915 | unsigned int irq; | 915 | int irq, retval; |
| 916 | int retval; | ||
| 917 | 916 | ||
| 918 | irq = bind_evtchn_to_irq(evtchn); | 917 | irq = bind_evtchn_to_irq(evtchn); |
| 919 | if (irq < 0) | 918 | if (irq < 0) |
| @@ -955,8 +954,7 @@ int bind_virq_to_irqhandler(unsigned int virq, unsigned int cpu, | |||
| 955 | irq_handler_t handler, | 954 | irq_handler_t handler, |
| 956 | unsigned long irqflags, const char *devname, void *dev_id) | 955 | unsigned long irqflags, const char *devname, void *dev_id) |
| 957 | { | 956 | { |
| 958 | unsigned int irq; | 957 | int irq, retval; |
| 959 | int retval; | ||
| 960 | 958 | ||
| 961 | irq = bind_virq_to_irq(virq, cpu); | 959 | irq = bind_virq_to_irq(virq, cpu); |
| 962 | if (irq < 0) | 960 | if (irq < 0) |
diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c index 95143dd6904d..1ac94125bf93 100644 --- a/drivers/xen/manage.c +++ b/drivers/xen/manage.c | |||
| @@ -61,7 +61,7 @@ static void xen_post_suspend(int cancelled) | |||
| 61 | xen_mm_unpin_all(); | 61 | xen_mm_unpin_all(); |
| 62 | } | 62 | } |
| 63 | 63 | ||
| 64 | #ifdef CONFIG_HIBERNATION | 64 | #ifdef CONFIG_HIBERNATE_CALLBACKS |
| 65 | static int xen_suspend(void *data) | 65 | static int xen_suspend(void *data) |
| 66 | { | 66 | { |
| 67 | struct suspend_info *si = data; | 67 | struct suspend_info *si = data; |
| @@ -173,7 +173,7 @@ out: | |||
| 173 | #endif | 173 | #endif |
| 174 | shutting_down = SHUTDOWN_INVALID; | 174 | shutting_down = SHUTDOWN_INVALID; |
| 175 | } | 175 | } |
| 176 | #endif /* CONFIG_HIBERNATION */ | 176 | #endif /* CONFIG_HIBERNATE_CALLBACKS */ |
| 177 | 177 | ||
| 178 | struct shutdown_handler { | 178 | struct shutdown_handler { |
| 179 | const char *command; | 179 | const char *command; |
| @@ -202,7 +202,7 @@ static void shutdown_handler(struct xenbus_watch *watch, | |||
| 202 | { "poweroff", do_poweroff }, | 202 | { "poweroff", do_poweroff }, |
| 203 | { "halt", do_poweroff }, | 203 | { "halt", do_poweroff }, |
| 204 | { "reboot", do_reboot }, | 204 | { "reboot", do_reboot }, |
| 205 | #ifdef CONFIG_HIBERNATION | 205 | #ifdef CONFIG_HIBERNATE_CALLBACKS |
| 206 | { "suspend", do_suspend }, | 206 | { "suspend", do_suspend }, |
| 207 | #endif | 207 | #endif |
| 208 | {NULL, NULL}, | 208 | {NULL, NULL}, |
