aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/acpi/osl.c34
-rw-r--r--drivers/video/aty/radeon_i2c.c8
-rw-r--r--drivers/video/fb_ddc.c6
3 files changed, 31 insertions, 17 deletions
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index c84286cbbe25..068fe4f100b0 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -73,7 +73,6 @@ static unsigned int acpi_irq_irq;
73static acpi_osd_handler acpi_irq_handler; 73static acpi_osd_handler acpi_irq_handler;
74static void *acpi_irq_context; 74static void *acpi_irq_context;
75static struct workqueue_struct *kacpid_wq; 75static struct workqueue_struct *kacpid_wq;
76static struct workqueue_struct *kacpi_notify_wq;
77 76
78acpi_status acpi_os_initialize(void) 77acpi_status acpi_os_initialize(void)
79{ 78{
@@ -92,9 +91,8 @@ acpi_status acpi_os_initialize1(void)
92 return AE_NULL_ENTRY; 91 return AE_NULL_ENTRY;
93 } 92 }
94 kacpid_wq = create_singlethread_workqueue("kacpid"); 93 kacpid_wq = create_singlethread_workqueue("kacpid");
95 kacpi_notify_wq = create_singlethread_workqueue("kacpi_notify");
96 BUG_ON(!kacpid_wq); 94 BUG_ON(!kacpid_wq);
97 BUG_ON(!kacpi_notify_wq); 95
98 return AE_OK; 96 return AE_OK;
99} 97}
100 98
@@ -106,7 +104,6 @@ acpi_status acpi_os_terminate(void)
106 } 104 }
107 105
108 destroy_workqueue(kacpid_wq); 106 destroy_workqueue(kacpid_wq);
109 destroy_workqueue(kacpi_notify_wq);
110 107
111 return AE_OK; 108 return AE_OK;
112} 109}
@@ -569,7 +566,10 @@ void acpi_os_derive_pci_id(acpi_handle rhandle, /* upper bound */
569 566
570static void acpi_os_execute_deferred(void *context) 567static void acpi_os_execute_deferred(void *context)
571{ 568{
572 struct acpi_os_dpc *dpc = (struct acpi_os_dpc *)context; 569 struct acpi_os_dpc *dpc = NULL;
570
571
572 dpc = (struct acpi_os_dpc *)context;
573 if (!dpc) { 573 if (!dpc) {
574 printk(KERN_ERR PREFIX "Invalid (NULL) context\n"); 574 printk(KERN_ERR PREFIX "Invalid (NULL) context\n");
575 return; 575 return;
@@ -604,12 +604,14 @@ acpi_status acpi_os_execute(acpi_execute_type type,
604 struct acpi_os_dpc *dpc; 604 struct acpi_os_dpc *dpc;
605 struct work_struct *task; 605 struct work_struct *task;
606 606
607 ACPI_FUNCTION_TRACE("os_queue_for_execution");
608
607 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, 609 ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
608 "Scheduling function [%p(%p)] for deferred execution.\n", 610 "Scheduling function [%p(%p)] for deferred execution.\n",
609 function, context)); 611 function, context));
610 612
611 if (!function) 613 if (!function)
612 return AE_BAD_PARAMETER; 614 return_ACPI_STATUS(AE_BAD_PARAMETER);
613 615
614 /* 616 /*
615 * Allocate/initialize DPC structure. Note that this memory will be 617 * Allocate/initialize DPC structure. Note that this memory will be
@@ -622,20 +624,26 @@ acpi_status acpi_os_execute(acpi_execute_type type,
622 * from the same memory. 624 * from the same memory.
623 */ 625 */
624 626
625 dpc = kmalloc(sizeof(struct acpi_os_dpc) + 627 dpc =
626 sizeof(struct work_struct), GFP_ATOMIC); 628 kmalloc(sizeof(struct acpi_os_dpc) + sizeof(struct work_struct),
629 GFP_ATOMIC);
627 if (!dpc) 630 if (!dpc)
628 return AE_NO_MEMORY; 631 return_ACPI_STATUS(AE_NO_MEMORY);
632
629 dpc->function = function; 633 dpc->function = function;
630 dpc->context = context; 634 dpc->context = context;
635
631 task = (void *)(dpc + 1); 636 task = (void *)(dpc + 1);
632 INIT_WORK(task, acpi_os_execute_deferred, (void *)dpc); 637 INIT_WORK(task, acpi_os_execute_deferred, (void *)dpc);
633 if (!queue_work((type == OSL_NOTIFY_HANDLER)? 638
634 kacpi_notify_wq : kacpid_wq, task)) { 639 if (!queue_work(kacpid_wq, task)) {
635 status = AE_ERROR; 640 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
641 "Call to queue_work() failed.\n"));
636 kfree(dpc); 642 kfree(dpc);
643 status = AE_ERROR;
637 } 644 }
638 return status; 645
646 return_ACPI_STATUS(status);
639} 647}
640 648
641EXPORT_SYMBOL(acpi_os_execute); 649EXPORT_SYMBOL(acpi_os_execute);
diff --git a/drivers/video/aty/radeon_i2c.c b/drivers/video/aty/radeon_i2c.c
index 676754520099..869725a13c21 100644
--- a/drivers/video/aty/radeon_i2c.c
+++ b/drivers/video/aty/radeon_i2c.c
@@ -139,7 +139,13 @@ void radeon_delete_i2c_busses(struct radeonfb_info *rinfo)
139int radeon_probe_i2c_connector(struct radeonfb_info *rinfo, int conn, 139int radeon_probe_i2c_connector(struct radeonfb_info *rinfo, int conn,
140 u8 **out_edid) 140 u8 **out_edid)
141{ 141{
142 u8 *edid = fb_ddc_read(&rinfo->i2c[conn-1].adapter); 142 u32 reg = rinfo->i2c[conn-1].ddc_reg;
143 u8 *edid;
144
145 OUTREG(reg, INREG(reg) &
146 ~(VGA_DDC_DATA_OUTPUT | VGA_DDC_CLK_OUTPUT));
147
148 edid = fb_ddc_read(&rinfo->i2c[conn-1].adapter);
143 149
144 if (out_edid) 150 if (out_edid)
145 *out_edid = edid; 151 *out_edid = edid;
diff --git a/drivers/video/fb_ddc.c b/drivers/video/fb_ddc.c
index 3aa6ebf68f17..f836137a0eda 100644
--- a/drivers/video/fb_ddc.c
+++ b/drivers/video/fb_ddc.c
@@ -20,26 +20,26 @@
20static unsigned char *fb_do_probe_ddc_edid(struct i2c_adapter *adapter) 20static unsigned char *fb_do_probe_ddc_edid(struct i2c_adapter *adapter)
21{ 21{
22 unsigned char start = 0x0; 22 unsigned char start = 0x0;
23 unsigned char *buf = kmalloc(EDID_LENGTH, GFP_KERNEL);
23 struct i2c_msg msgs[] = { 24 struct i2c_msg msgs[] = {
24 { 25 {
25 .addr = DDC_ADDR, 26 .addr = DDC_ADDR,
27 .flags = 0,
26 .len = 1, 28 .len = 1,
27 .buf = &start, 29 .buf = &start,
28 }, { 30 }, {
29 .addr = DDC_ADDR, 31 .addr = DDC_ADDR,
30 .flags = I2C_M_RD, 32 .flags = I2C_M_RD,
31 .len = EDID_LENGTH, 33 .len = EDID_LENGTH,
34 .buf = buf,
32 } 35 }
33 }; 36 };
34 unsigned char *buf;
35 37
36 buf = kmalloc(EDID_LENGTH, GFP_KERNEL);
37 if (!buf) { 38 if (!buf) {
38 dev_warn(&adapter->dev, "unable to allocate memory for EDID " 39 dev_warn(&adapter->dev, "unable to allocate memory for EDID "
39 "block.\n"); 40 "block.\n");
40 return NULL; 41 return NULL;
41 } 42 }
42 msgs[1].buf = buf;
43 43
44 if (i2c_transfer(adapter, msgs, 2) == 2) 44 if (i2c_transfer(adapter, msgs, 2) == 2)
45 return buf; 45 return buf;