mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
Merge branch 'linus' into irq/core
Pull in upstream fixes before applying conflicting changes
This commit is contained in:
commit
4b979e4c61
964 changed files with 10692 additions and 6149 deletions
|
|
@ -563,10 +563,8 @@ static void fw_dev_release(struct device *dev)
|
|||
kfree(fw_priv);
|
||||
}
|
||||
|
||||
static int firmware_uevent(struct device *dev, struct kobj_uevent_env *env)
|
||||
static int do_firmware_uevent(struct firmware_priv *fw_priv, struct kobj_uevent_env *env)
|
||||
{
|
||||
struct firmware_priv *fw_priv = to_firmware_priv(dev);
|
||||
|
||||
if (add_uevent_var(env, "FIRMWARE=%s", fw_priv->buf->fw_id))
|
||||
return -ENOMEM;
|
||||
if (add_uevent_var(env, "TIMEOUT=%i", loading_timeout))
|
||||
|
|
@ -577,6 +575,18 @@ static int firmware_uevent(struct device *dev, struct kobj_uevent_env *env)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int firmware_uevent(struct device *dev, struct kobj_uevent_env *env)
|
||||
{
|
||||
struct firmware_priv *fw_priv = to_firmware_priv(dev);
|
||||
int err = 0;
|
||||
|
||||
mutex_lock(&fw_lock);
|
||||
if (fw_priv->buf)
|
||||
err = do_firmware_uevent(fw_priv, env);
|
||||
mutex_unlock(&fw_lock);
|
||||
return err;
|
||||
}
|
||||
|
||||
static struct class firmware_class = {
|
||||
.name = "firmware",
|
||||
.class_attrs = firmware_class_attrs,
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
* This file is released under the GPLv2.
|
||||
*/
|
||||
|
||||
#include <linux/delay.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/platform_device.h>
|
||||
|
|
@ -19,6 +20,8 @@
|
|||
#include <linux/suspend.h>
|
||||
#include <linux/export.h>
|
||||
|
||||
#define GENPD_RETRY_MAX_MS 250 /* Approximate */
|
||||
|
||||
#define GENPD_DEV_CALLBACK(genpd, type, callback, dev) \
|
||||
({ \
|
||||
type (*__routine)(struct device *__d); \
|
||||
|
|
@ -2131,6 +2134,7 @@ EXPORT_SYMBOL_GPL(of_genpd_get_from_provider);
|
|||
static void genpd_dev_pm_detach(struct device *dev, bool power_off)
|
||||
{
|
||||
struct generic_pm_domain *pd;
|
||||
unsigned int i;
|
||||
int ret = 0;
|
||||
|
||||
pd = pm_genpd_lookup_dev(dev);
|
||||
|
|
@ -2139,10 +2143,12 @@ static void genpd_dev_pm_detach(struct device *dev, bool power_off)
|
|||
|
||||
dev_dbg(dev, "removing from PM domain %s\n", pd->name);
|
||||
|
||||
while (1) {
|
||||
for (i = 1; i < GENPD_RETRY_MAX_MS; i <<= 1) {
|
||||
ret = pm_genpd_remove_device(pd, dev);
|
||||
if (ret != -EAGAIN)
|
||||
break;
|
||||
|
||||
mdelay(i);
|
||||
cond_resched();
|
||||
}
|
||||
|
||||
|
|
@ -2183,6 +2189,7 @@ int genpd_dev_pm_attach(struct device *dev)
|
|||
{
|
||||
struct of_phandle_args pd_args;
|
||||
struct generic_pm_domain *pd;
|
||||
unsigned int i;
|
||||
int ret;
|
||||
|
||||
if (!dev->of_node)
|
||||
|
|
@ -2218,10 +2225,12 @@ int genpd_dev_pm_attach(struct device *dev)
|
|||
|
||||
dev_dbg(dev, "adding to PM domain %s\n", pd->name);
|
||||
|
||||
while (1) {
|
||||
for (i = 1; i < GENPD_RETRY_MAX_MS; i <<= 1) {
|
||||
ret = pm_genpd_add_device(pd, dev);
|
||||
if (ret != -EAGAIN)
|
||||
break;
|
||||
|
||||
mdelay(i);
|
||||
cond_resched();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -45,14 +45,12 @@ static int dev_pm_attach_wake_irq(struct device *dev, int irq,
|
|||
return -EEXIST;
|
||||
}
|
||||
|
||||
dev->power.wakeirq = wirq;
|
||||
spin_unlock_irqrestore(&dev->power.lock, flags);
|
||||
|
||||
err = device_wakeup_attach_irq(dev, wirq);
|
||||
if (err)
|
||||
return err;
|
||||
if (!err)
|
||||
dev->power.wakeirq = wirq;
|
||||
|
||||
return 0;
|
||||
spin_unlock_irqrestore(&dev->power.lock, flags);
|
||||
return err;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -105,10 +103,10 @@ void dev_pm_clear_wake_irq(struct device *dev)
|
|||
return;
|
||||
|
||||
spin_lock_irqsave(&dev->power.lock, flags);
|
||||
device_wakeup_detach_irq(dev);
|
||||
dev->power.wakeirq = NULL;
|
||||
spin_unlock_irqrestore(&dev->power.lock, flags);
|
||||
|
||||
device_wakeup_detach_irq(dev);
|
||||
if (wirq->dedicated_irq)
|
||||
free_irq(wirq->irq, wirq);
|
||||
kfree(wirq);
|
||||
|
|
|
|||
|
|
@ -281,32 +281,25 @@ EXPORT_SYMBOL_GPL(device_wakeup_enable);
|
|||
* Attach a device wakeirq to the wakeup source so the device
|
||||
* wake IRQ can be configured automatically for suspend and
|
||||
* resume.
|
||||
*
|
||||
* Call under the device's power.lock lock.
|
||||
*/
|
||||
int device_wakeup_attach_irq(struct device *dev,
|
||||
struct wake_irq *wakeirq)
|
||||
{
|
||||
struct wakeup_source *ws;
|
||||
int ret = 0;
|
||||
|
||||
spin_lock_irq(&dev->power.lock);
|
||||
ws = dev->power.wakeup;
|
||||
if (!ws) {
|
||||
dev_err(dev, "forgot to call call device_init_wakeup?\n");
|
||||
ret = -EINVAL;
|
||||
goto unlock;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (ws->wakeirq) {
|
||||
ret = -EEXIST;
|
||||
goto unlock;
|
||||
}
|
||||
if (ws->wakeirq)
|
||||
return -EEXIST;
|
||||
|
||||
ws->wakeirq = wakeirq;
|
||||
|
||||
unlock:
|
||||
spin_unlock_irq(&dev->power.lock);
|
||||
|
||||
return ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -314,20 +307,16 @@ unlock:
|
|||
* @dev: Device to handle
|
||||
*
|
||||
* Removes a device wakeirq from the wakeup source.
|
||||
*
|
||||
* Call under the device's power.lock lock.
|
||||
*/
|
||||
void device_wakeup_detach_irq(struct device *dev)
|
||||
{
|
||||
struct wakeup_source *ws;
|
||||
|
||||
spin_lock_irq(&dev->power.lock);
|
||||
ws = dev->power.wakeup;
|
||||
if (!ws)
|
||||
goto unlock;
|
||||
|
||||
ws->wakeirq = NULL;
|
||||
|
||||
unlock:
|
||||
spin_unlock_irq(&dev->power.lock);
|
||||
if (ws)
|
||||
ws->wakeirq = NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue