diff options
-rw-r--r-- | drivers/char/sonypi.c | 27 | ||||
-rw-r--r-- | drivers/misc/sony-laptop.c | 4 |
2 files changed, 29 insertions, 2 deletions
diff --git a/drivers/char/sonypi.c b/drivers/char/sonypi.c index 72cdddb0ee6f..b6998906b214 100644 --- a/drivers/char/sonypi.c +++ b/drivers/char/sonypi.c | |||
@@ -97,6 +97,11 @@ module_param(useinput, int, 0444); | |||
97 | MODULE_PARM_DESC(useinput, | 97 | MODULE_PARM_DESC(useinput, |
98 | "set this if you would like sonypi to feed events to the input subsystem"); | 98 | "set this if you would like sonypi to feed events to the input subsystem"); |
99 | 99 | ||
100 | static int check_ioport = 1; | ||
101 | module_param(check_ioport, int, 0444); | ||
102 | MODULE_PARM_DESC(check_ioport, | ||
103 | "set this to 0 if you think the automatic ioport check for sony-laptop is wrong"); | ||
104 | |||
100 | #define SONYPI_DEVICE_MODEL_TYPE1 1 | 105 | #define SONYPI_DEVICE_MODEL_TYPE1 1 |
101 | #define SONYPI_DEVICE_MODEL_TYPE2 2 | 106 | #define SONYPI_DEVICE_MODEL_TYPE2 2 |
102 | #define SONYPI_DEVICE_MODEL_TYPE3 3 | 107 | #define SONYPI_DEVICE_MODEL_TYPE3 3 |
@@ -1262,6 +1267,28 @@ static int __devinit sonypi_create_input_devices(void) | |||
1262 | static int __devinit sonypi_setup_ioports(struct sonypi_device *dev, | 1267 | static int __devinit sonypi_setup_ioports(struct sonypi_device *dev, |
1263 | const struct sonypi_ioport_list *ioport_list) | 1268 | const struct sonypi_ioport_list *ioport_list) |
1264 | { | 1269 | { |
1270 | /* try to detect if sony-laptop is being used and thus | ||
1271 | * has already requested one of the known ioports. | ||
1272 | * As in the deprecated check_region this is racy has we have | ||
1273 | * multiple ioports available and one of them can be requested | ||
1274 | * between this check and the subsequent request. Anyway, as an | ||
1275 | * attempt to be some more user-friendly as we currently are, | ||
1276 | * this is enough. | ||
1277 | */ | ||
1278 | const struct sonypi_ioport_list *check = ioport_list; | ||
1279 | while (check_ioport && check->port1) { | ||
1280 | if (!request_region(check->port1, | ||
1281 | sonypi_device.region_size, | ||
1282 | "Sony Programable I/O Device Check")) { | ||
1283 | printk(KERN_ERR "sonypi: ioport 0x%.4x busy, using sony-laptop? " | ||
1284 | "if not use check_ioport=0\n", | ||
1285 | check->port1); | ||
1286 | return -EBUSY; | ||
1287 | } | ||
1288 | release_region(check->port1, sonypi_device.region_size); | ||
1289 | check++; | ||
1290 | } | ||
1291 | |||
1265 | while (ioport_list->port1) { | 1292 | while (ioport_list->port1) { |
1266 | 1293 | ||
1267 | if (request_region(ioport_list->port1, | 1294 | if (request_region(ioport_list->port1, |
diff --git a/drivers/misc/sony-laptop.c b/drivers/misc/sony-laptop.c index 141284dee1a1..2787e1ce8911 100644 --- a/drivers/misc/sony-laptop.c +++ b/drivers/misc/sony-laptop.c | |||
@@ -1801,7 +1801,7 @@ sony_pic_read_possible_resource(struct acpi_resource *resource, void *context) | |||
1801 | if (!interrupt) | 1801 | if (!interrupt) |
1802 | return AE_ERROR; | 1802 | return AE_ERROR; |
1803 | 1803 | ||
1804 | list_add(&interrupt->list, &dev->interrupts); | 1804 | list_add_tail(&interrupt->list, &dev->interrupts); |
1805 | interrupt->irq.triggering = p->triggering; | 1805 | interrupt->irq.triggering = p->triggering; |
1806 | interrupt->irq.polarity = p->polarity; | 1806 | interrupt->irq.polarity = p->polarity; |
1807 | interrupt->irq.sharable = p->sharable; | 1807 | interrupt->irq.sharable = p->sharable; |
@@ -1823,7 +1823,7 @@ sony_pic_read_possible_resource(struct acpi_resource *resource, void *context) | |||
1823 | if (!ioport) | 1823 | if (!ioport) |
1824 | return AE_ERROR; | 1824 | return AE_ERROR; |
1825 | 1825 | ||
1826 | list_add(&ioport->list, &dev->ioports); | 1826 | list_add_tail(&ioport->list, &dev->ioports); |
1827 | memcpy(&ioport->io, io, sizeof(*io)); | 1827 | memcpy(&ioport->io, io, sizeof(*io)); |
1828 | return AE_OK; | 1828 | return AE_OK; |
1829 | } | 1829 | } |