diff options
Diffstat (limited to 'drivers/macintosh')
-rw-r--r-- | drivers/macintosh/therm_adt746x.c | 4 | ||||
-rw-r--r-- | drivers/macintosh/therm_pm72.c | 4 | ||||
-rw-r--r-- | drivers/macintosh/via-pmu.c | 40 | ||||
-rw-r--r-- | drivers/macintosh/windfarm_lm75_sensor.c | 4 | ||||
-rw-r--r-- | drivers/macintosh/windfarm_max6690_sensor.c | 4 | ||||
-rw-r--r-- | drivers/macintosh/windfarm_smu_sat.c | 4 |
6 files changed, 38 insertions, 22 deletions
diff --git a/drivers/macintosh/therm_adt746x.c b/drivers/macintosh/therm_adt746x.c index fde377c60cca..556f0feaa4df 100644 --- a/drivers/macintosh/therm_adt746x.c +++ b/drivers/macintosh/therm_adt746x.c | |||
@@ -124,6 +124,8 @@ read_reg(struct thermostat* th, int reg) | |||
124 | return data; | 124 | return data; |
125 | } | 125 | } |
126 | 126 | ||
127 | static struct i2c_driver thermostat_driver; | ||
128 | |||
127 | static int | 129 | static int |
128 | attach_thermostat(struct i2c_adapter *adapter) | 130 | attach_thermostat(struct i2c_adapter *adapter) |
129 | { | 131 | { |
@@ -148,7 +150,7 @@ attach_thermostat(struct i2c_adapter *adapter) | |||
148 | * Let i2c-core delete that device on driver removal. | 150 | * Let i2c-core delete that device on driver removal. |
149 | * This is safe because i2c-core holds the core_lock mutex for us. | 151 | * This is safe because i2c-core holds the core_lock mutex for us. |
150 | */ | 152 | */ |
151 | list_add_tail(&client->detected, &client->driver->clients); | 153 | list_add_tail(&client->detected, &thermostat_driver.clients); |
152 | return 0; | 154 | return 0; |
153 | } | 155 | } |
154 | 156 | ||
diff --git a/drivers/macintosh/therm_pm72.c b/drivers/macintosh/therm_pm72.c index a028598af2d3..ea32c7e5a9af 100644 --- a/drivers/macintosh/therm_pm72.c +++ b/drivers/macintosh/therm_pm72.c | |||
@@ -286,6 +286,8 @@ struct fcu_fan_table fcu_fans[] = { | |||
286 | }, | 286 | }, |
287 | }; | 287 | }; |
288 | 288 | ||
289 | static struct i2c_driver therm_pm72_driver; | ||
290 | |||
289 | /* | 291 | /* |
290 | * Utility function to create an i2c_client structure and | 292 | * Utility function to create an i2c_client structure and |
291 | * attach it to one of u3 adapters | 293 | * attach it to one of u3 adapters |
@@ -318,7 +320,7 @@ static struct i2c_client *attach_i2c_chip(int id, const char *name) | |||
318 | * Let i2c-core delete that device on driver removal. | 320 | * Let i2c-core delete that device on driver removal. |
319 | * This is safe because i2c-core holds the core_lock mutex for us. | 321 | * This is safe because i2c-core holds the core_lock mutex for us. |
320 | */ | 322 | */ |
321 | list_add_tail(&clt->detected, &clt->driver->clients); | 323 | list_add_tail(&clt->detected, &therm_pm72_driver.clients); |
322 | return clt; | 324 | return clt; |
323 | } | 325 | } |
324 | 326 | ||
diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c index b40fb9b6c862..6f308a4757ee 100644 --- a/drivers/macintosh/via-pmu.c +++ b/drivers/macintosh/via-pmu.c | |||
@@ -405,7 +405,11 @@ static int __init via_pmu_start(void) | |||
405 | printk(KERN_ERR "via-pmu: can't map interrupt\n"); | 405 | printk(KERN_ERR "via-pmu: can't map interrupt\n"); |
406 | return -ENODEV; | 406 | return -ENODEV; |
407 | } | 407 | } |
408 | if (request_irq(irq, via_pmu_interrupt, 0, "VIA-PMU", (void *)0)) { | 408 | /* We set IRQF_TIMER because we don't want the interrupt to be disabled |
409 | * between the 2 passes of driver suspend, we control our own disabling | ||
410 | * for that one | ||
411 | */ | ||
412 | if (request_irq(irq, via_pmu_interrupt, IRQF_TIMER, "VIA-PMU", (void *)0)) { | ||
409 | printk(KERN_ERR "via-pmu: can't request irq %d\n", irq); | 413 | printk(KERN_ERR "via-pmu: can't request irq %d\n", irq); |
410 | return -ENODEV; | 414 | return -ENODEV; |
411 | } | 415 | } |
@@ -419,7 +423,7 @@ static int __init via_pmu_start(void) | |||
419 | gpio_irq = irq_of_parse_and_map(gpio_node, 0); | 423 | gpio_irq = irq_of_parse_and_map(gpio_node, 0); |
420 | 424 | ||
421 | if (gpio_irq != NO_IRQ) { | 425 | if (gpio_irq != NO_IRQ) { |
422 | if (request_irq(gpio_irq, gpio1_interrupt, 0, | 426 | if (request_irq(gpio_irq, gpio1_interrupt, IRQF_TIMER, |
423 | "GPIO1 ADB", (void *)0)) | 427 | "GPIO1 ADB", (void *)0)) |
424 | printk(KERN_ERR "pmu: can't get irq %d" | 428 | printk(KERN_ERR "pmu: can't get irq %d" |
425 | " (GPIO1)\n", gpio_irq); | 429 | " (GPIO1)\n", gpio_irq); |
@@ -925,8 +929,7 @@ proc_write_options(struct file *file, const char __user *buffer, | |||
925 | 929 | ||
926 | #ifdef CONFIG_ADB | 930 | #ifdef CONFIG_ADB |
927 | /* Send an ADB command */ | 931 | /* Send an ADB command */ |
928 | static int | 932 | static int pmu_send_request(struct adb_request *req, int sync) |
929 | pmu_send_request(struct adb_request *req, int sync) | ||
930 | { | 933 | { |
931 | int i, ret; | 934 | int i, ret; |
932 | 935 | ||
@@ -1005,16 +1008,11 @@ pmu_send_request(struct adb_request *req, int sync) | |||
1005 | } | 1008 | } |
1006 | 1009 | ||
1007 | /* Enable/disable autopolling */ | 1010 | /* Enable/disable autopolling */ |
1008 | static int | 1011 | static int __pmu_adb_autopoll(int devs) |
1009 | pmu_adb_autopoll(int devs) | ||
1010 | { | 1012 | { |
1011 | struct adb_request req; | 1013 | struct adb_request req; |
1012 | 1014 | ||
1013 | if ((vias == NULL) || (!pmu_fully_inited) || !pmu_has_adb) | ||
1014 | return -ENXIO; | ||
1015 | |||
1016 | if (devs) { | 1015 | if (devs) { |
1017 | adb_dev_map = devs; | ||
1018 | pmu_request(&req, NULL, 5, PMU_ADB_CMD, 0, 0x86, | 1016 | pmu_request(&req, NULL, 5, PMU_ADB_CMD, 0, 0x86, |
1019 | adb_dev_map >> 8, adb_dev_map); | 1017 | adb_dev_map >> 8, adb_dev_map); |
1020 | pmu_adb_flags = 2; | 1018 | pmu_adb_flags = 2; |
@@ -1027,9 +1025,17 @@ pmu_adb_autopoll(int devs) | |||
1027 | return 0; | 1025 | return 0; |
1028 | } | 1026 | } |
1029 | 1027 | ||
1028 | static int pmu_adb_autopoll(int devs) | ||
1029 | { | ||
1030 | if ((vias == NULL) || (!pmu_fully_inited) || !pmu_has_adb) | ||
1031 | return -ENXIO; | ||
1032 | |||
1033 | adb_dev_map = devs; | ||
1034 | return __pmu_adb_autopoll(devs); | ||
1035 | } | ||
1036 | |||
1030 | /* Reset the ADB bus */ | 1037 | /* Reset the ADB bus */ |
1031 | static int | 1038 | static int pmu_adb_reset_bus(void) |
1032 | pmu_adb_reset_bus(void) | ||
1033 | { | 1039 | { |
1034 | struct adb_request req; | 1040 | struct adb_request req; |
1035 | int save_autopoll = adb_dev_map; | 1041 | int save_autopoll = adb_dev_map; |
@@ -1038,13 +1044,13 @@ pmu_adb_reset_bus(void) | |||
1038 | return -ENXIO; | 1044 | return -ENXIO; |
1039 | 1045 | ||
1040 | /* anyone got a better idea?? */ | 1046 | /* anyone got a better idea?? */ |
1041 | pmu_adb_autopoll(0); | 1047 | __pmu_adb_autopoll(0); |
1042 | 1048 | ||
1043 | req.nbytes = 5; | 1049 | req.nbytes = 4; |
1044 | req.done = NULL; | 1050 | req.done = NULL; |
1045 | req.data[0] = PMU_ADB_CMD; | 1051 | req.data[0] = PMU_ADB_CMD; |
1046 | req.data[1] = 0; | 1052 | req.data[1] = ADB_BUSRESET; |
1047 | req.data[2] = ADB_BUSRESET; | 1053 | req.data[2] = 0; |
1048 | req.data[3] = 0; | 1054 | req.data[3] = 0; |
1049 | req.data[4] = 0; | 1055 | req.data[4] = 0; |
1050 | req.reply_len = 0; | 1056 | req.reply_len = 0; |
@@ -1056,7 +1062,7 @@ pmu_adb_reset_bus(void) | |||
1056 | pmu_wait_complete(&req); | 1062 | pmu_wait_complete(&req); |
1057 | 1063 | ||
1058 | if (save_autopoll != 0) | 1064 | if (save_autopoll != 0) |
1059 | pmu_adb_autopoll(save_autopoll); | 1065 | __pmu_adb_autopoll(save_autopoll); |
1060 | 1066 | ||
1061 | return 0; | 1067 | return 0; |
1062 | } | 1068 | } |
diff --git a/drivers/macintosh/windfarm_lm75_sensor.c b/drivers/macintosh/windfarm_lm75_sensor.c index 529886c7a826..ed6426a10773 100644 --- a/drivers/macintosh/windfarm_lm75_sensor.c +++ b/drivers/macintosh/windfarm_lm75_sensor.c | |||
@@ -115,6 +115,8 @@ static int wf_lm75_probe(struct i2c_client *client, | |||
115 | return rc; | 115 | return rc; |
116 | } | 116 | } |
117 | 117 | ||
118 | static struct i2c_driver wf_lm75_driver; | ||
119 | |||
118 | static struct i2c_client *wf_lm75_create(struct i2c_adapter *adapter, | 120 | static struct i2c_client *wf_lm75_create(struct i2c_adapter *adapter, |
119 | u8 addr, int ds1775, | 121 | u8 addr, int ds1775, |
120 | const char *loc) | 122 | const char *loc) |
@@ -157,7 +159,7 @@ static struct i2c_client *wf_lm75_create(struct i2c_adapter *adapter, | |||
157 | * Let i2c-core delete that device on driver removal. | 159 | * Let i2c-core delete that device on driver removal. |
158 | * This is safe because i2c-core holds the core_lock mutex for us. | 160 | * This is safe because i2c-core holds the core_lock mutex for us. |
159 | */ | 161 | */ |
160 | list_add_tail(&client->detected, &client->driver->clients); | 162 | list_add_tail(&client->detected, &wf_lm75_driver.clients); |
161 | return client; | 163 | return client; |
162 | fail: | 164 | fail: |
163 | return NULL; | 165 | return NULL; |
diff --git a/drivers/macintosh/windfarm_max6690_sensor.c b/drivers/macintosh/windfarm_max6690_sensor.c index e2a55ecda2b2..a67b349319e9 100644 --- a/drivers/macintosh/windfarm_max6690_sensor.c +++ b/drivers/macintosh/windfarm_max6690_sensor.c | |||
@@ -88,6 +88,8 @@ static int wf_max6690_probe(struct i2c_client *client, | |||
88 | return rc; | 88 | return rc; |
89 | } | 89 | } |
90 | 90 | ||
91 | static struct i2c_driver wf_max6690_driver; | ||
92 | |||
91 | static struct i2c_client *wf_max6690_create(struct i2c_adapter *adapter, | 93 | static struct i2c_client *wf_max6690_create(struct i2c_adapter *adapter, |
92 | u8 addr, const char *loc) | 94 | u8 addr, const char *loc) |
93 | { | 95 | { |
@@ -119,7 +121,7 @@ static struct i2c_client *wf_max6690_create(struct i2c_adapter *adapter, | |||
119 | * Let i2c-core delete that device on driver removal. | 121 | * Let i2c-core delete that device on driver removal. |
120 | * This is safe because i2c-core holds the core_lock mutex for us. | 122 | * This is safe because i2c-core holds the core_lock mutex for us. |
121 | */ | 123 | */ |
122 | list_add_tail(&client->detected, &client->driver->clients); | 124 | list_add_tail(&client->detected, &wf_max6690_driver.clients); |
123 | return client; | 125 | return client; |
124 | 126 | ||
125 | fail: | 127 | fail: |
diff --git a/drivers/macintosh/windfarm_smu_sat.c b/drivers/macintosh/windfarm_smu_sat.c index 5da729e58f99..e20330a28959 100644 --- a/drivers/macintosh/windfarm_smu_sat.c +++ b/drivers/macintosh/windfarm_smu_sat.c | |||
@@ -194,6 +194,8 @@ static struct wf_sensor_ops wf_sat_ops = { | |||
194 | .owner = THIS_MODULE, | 194 | .owner = THIS_MODULE, |
195 | }; | 195 | }; |
196 | 196 | ||
197 | static struct i2c_driver wf_sat_driver; | ||
198 | |||
197 | static void wf_sat_create(struct i2c_adapter *adapter, struct device_node *dev) | 199 | static void wf_sat_create(struct i2c_adapter *adapter, struct device_node *dev) |
198 | { | 200 | { |
199 | struct i2c_board_info info; | 201 | struct i2c_board_info info; |
@@ -222,7 +224,7 @@ static void wf_sat_create(struct i2c_adapter *adapter, struct device_node *dev) | |||
222 | * Let i2c-core delete that device on driver removal. | 224 | * Let i2c-core delete that device on driver removal. |
223 | * This is safe because i2c-core holds the core_lock mutex for us. | 225 | * This is safe because i2c-core holds the core_lock mutex for us. |
224 | */ | 226 | */ |
225 | list_add_tail(&client->detected, &client->driver->clients); | 227 | list_add_tail(&client->detected, &wf_sat_driver.clients); |
226 | } | 228 | } |
227 | 229 | ||
228 | static int wf_sat_probe(struct i2c_client *client, | 230 | static int wf_sat_probe(struct i2c_client *client, |