diff options
Diffstat (limited to 'drivers')
54 files changed, 3075 insertions, 858 deletions
diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c index 023a32cfac42..540166443c34 100644 --- a/drivers/gpio/gpio-pca953x.c +++ b/drivers/gpio/gpio-pca953x.c | |||
| @@ -449,7 +449,7 @@ static void pca953x_setup_gpio(struct pca953x_chip *chip, int gpios) | |||
| 449 | 449 | ||
| 450 | gc->base = chip->gpio_start; | 450 | gc->base = chip->gpio_start; |
| 451 | gc->ngpio = gpios; | 451 | gc->ngpio = gpios; |
| 452 | gc->label = chip->client->name; | 452 | gc->label = dev_name(&chip->client->dev); |
| 453 | gc->parent = &chip->client->dev; | 453 | gc->parent = &chip->client->dev; |
| 454 | gc->owner = THIS_MODULE; | 454 | gc->owner = THIS_MODULE; |
| 455 | gc->names = chip->names; | 455 | gc->names = chip->names; |
diff --git a/drivers/memstick/core/memstick.c b/drivers/memstick/core/memstick.c index 76382c858c35..1246d69ba187 100644 --- a/drivers/memstick/core/memstick.c +++ b/drivers/memstick/core/memstick.c | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | #include <linux/delay.h> | 18 | #include <linux/delay.h> |
| 19 | #include <linux/slab.h> | 19 | #include <linux/slab.h> |
| 20 | #include <linux/module.h> | 20 | #include <linux/module.h> |
| 21 | #include <linux/pm_runtime.h> | ||
| 21 | 22 | ||
| 22 | #define DRIVER_NAME "memstick" | 23 | #define DRIVER_NAME "memstick" |
| 23 | 24 | ||
| @@ -436,6 +437,7 @@ static void memstick_check(struct work_struct *work) | |||
| 436 | struct memstick_dev *card; | 437 | struct memstick_dev *card; |
| 437 | 438 | ||
| 438 | dev_dbg(&host->dev, "memstick_check started\n"); | 439 | dev_dbg(&host->dev, "memstick_check started\n"); |
| 440 | pm_runtime_get_noresume(host->dev.parent); | ||
| 439 | mutex_lock(&host->lock); | 441 | mutex_lock(&host->lock); |
| 440 | if (!host->card) { | 442 | if (!host->card) { |
| 441 | if (memstick_power_on(host)) | 443 | if (memstick_power_on(host)) |
| @@ -479,6 +481,7 @@ out_power_off: | |||
| 479 | host->set_param(host, MEMSTICK_POWER, MEMSTICK_POWER_OFF); | 481 | host->set_param(host, MEMSTICK_POWER, MEMSTICK_POWER_OFF); |
| 480 | 482 | ||
| 481 | mutex_unlock(&host->lock); | 483 | mutex_unlock(&host->lock); |
| 484 | pm_runtime_put(host->dev.parent); | ||
| 482 | dev_dbg(&host->dev, "memstick_check finished\n"); | 485 | dev_dbg(&host->dev, "memstick_check finished\n"); |
| 483 | } | 486 | } |
| 484 | 487 | ||
diff --git a/drivers/memstick/host/rtsx_usb_ms.c b/drivers/memstick/host/rtsx_usb_ms.c index 4f64563df7de..97308dc28ccf 100644 --- a/drivers/memstick/host/rtsx_usb_ms.c +++ b/drivers/memstick/host/rtsx_usb_ms.c | |||
| @@ -40,15 +40,14 @@ struct rtsx_usb_ms { | |||
| 40 | 40 | ||
| 41 | struct mutex host_mutex; | 41 | struct mutex host_mutex; |
| 42 | struct work_struct handle_req; | 42 | struct work_struct handle_req; |
| 43 | 43 | struct delayed_work poll_card; | |
| 44 | struct task_struct *detect_ms; | ||
| 45 | struct completion detect_ms_exit; | ||
| 46 | 44 | ||
| 47 | u8 ssc_depth; | 45 | u8 ssc_depth; |
| 48 | unsigned int clock; | 46 | unsigned int clock; |
| 49 | int power_mode; | 47 | int power_mode; |
| 50 | unsigned char ifmode; | 48 | unsigned char ifmode; |
| 51 | bool eject; | 49 | bool eject; |
| 50 | bool system_suspending; | ||
| 52 | }; | 51 | }; |
| 53 | 52 | ||
| 54 | static inline struct device *ms_dev(struct rtsx_usb_ms *host) | 53 | static inline struct device *ms_dev(struct rtsx_usb_ms *host) |
| @@ -545,7 +544,7 @@ static void rtsx_usb_ms_handle_req(struct work_struct *work) | |||
| 545 | host->req->error); | 544 | host->req->error); |
| 546 | } | 545 | } |
| 547 | } while (!rc); | 546 | } while (!rc); |
| 548 | pm_runtime_put(ms_dev(host)); | 547 | pm_runtime_put_sync(ms_dev(host)); |
| 549 | } | 548 | } |
| 550 | 549 | ||
| 551 | } | 550 | } |
| @@ -585,14 +584,14 @@ static int rtsx_usb_ms_set_param(struct memstick_host *msh, | |||
| 585 | break; | 584 | break; |
| 586 | 585 | ||
| 587 | if (value == MEMSTICK_POWER_ON) { | 586 | if (value == MEMSTICK_POWER_ON) { |
| 588 | pm_runtime_get_sync(ms_dev(host)); | 587 | pm_runtime_get_noresume(ms_dev(host)); |
| 589 | err = ms_power_on(host); | 588 | err = ms_power_on(host); |
| 589 | if (err) | ||
| 590 | pm_runtime_put_noidle(ms_dev(host)); | ||
| 590 | } else if (value == MEMSTICK_POWER_OFF) { | 591 | } else if (value == MEMSTICK_POWER_OFF) { |
| 591 | err = ms_power_off(host); | 592 | err = ms_power_off(host); |
| 592 | if (host->msh->card) | 593 | if (!err) |
| 593 | pm_runtime_put_noidle(ms_dev(host)); | 594 | pm_runtime_put_noidle(ms_dev(host)); |
| 594 | else | ||
| 595 | pm_runtime_put(ms_dev(host)); | ||
| 596 | } else | 595 | } else |
| 597 | err = -EINVAL; | 596 | err = -EINVAL; |
| 598 | if (!err) | 597 | if (!err) |
| @@ -638,12 +637,16 @@ static int rtsx_usb_ms_set_param(struct memstick_host *msh, | |||
| 638 | } | 637 | } |
| 639 | out: | 638 | out: |
| 640 | mutex_unlock(&ucr->dev_mutex); | 639 | mutex_unlock(&ucr->dev_mutex); |
| 641 | pm_runtime_put(ms_dev(host)); | 640 | pm_runtime_put_sync(ms_dev(host)); |
| 642 | 641 | ||
| 643 | /* power-on delay */ | 642 | /* power-on delay */ |
| 644 | if (param == MEMSTICK_POWER && value == MEMSTICK_POWER_ON) | 643 | if (param == MEMSTICK_POWER && value == MEMSTICK_POWER_ON) { |
| 645 | usleep_range(10000, 12000); | 644 | usleep_range(10000, 12000); |
| 646 | 645 | ||
| 646 | if (!host->eject) | ||
| 647 | |||
