Skip to content

Commit

Permalink
Merge branch 'android-omap-3.0' into android-omap-tuna-3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Iliyan Malchev committed Nov 30, 2011
2 parents d4fc7f8 + e4938a8 commit b1771ff
Show file tree
Hide file tree
Showing 10 changed files with 92 additions and 24 deletions.
2 changes: 1 addition & 1 deletion arch/arm/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,8 @@ void cpu_idle(void)

/* endless idle loop with no priority at all */
while (1) {
tick_nohz_stop_sched_tick(1);
idle_notifier_call_chain(IDLE_START);
tick_nohz_stop_sched_tick(1);
while (!need_resched()) {
#ifdef CONFIG_HOTPLUG_CPU
if (cpu_is_offline(smp_processor_id()))
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/cpuidle34xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ static int omap3_enter_idle(struct cpuidle_device *dev,
}

/* Execute ARM wfi */
omap_sram_idle();
omap_sram_idle(false);

/* Re-allow idle for C1 */
if (state == &dev->states[0]) {
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/pm.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

extern void *omap3_secure_ram_storage;
extern void omap3_pm_off_mode_enable(int);
extern void omap_sram_idle(void);
extern void omap_sram_idle(bool suspend);
extern int omap3_can_sleep(void);
extern int omap_set_pwrdm_state(struct powerdomain *pwrdm, u32 state);
extern int omap3_idle_init(void);
Expand Down
8 changes: 4 additions & 4 deletions arch/arm/mach-omap2/pm34xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ static void restore_table_entry(void)
set_cr(control_reg_value);
}

void omap_sram_idle(void)
void omap_sram_idle(bool suspend)
{
/* Variable to tell what needs to be saved and restored
* in omap_sram_idle*/
Expand Down Expand Up @@ -386,7 +386,7 @@ void omap_sram_idle(void)
/* PER */
if (per_next_state < PWRDM_POWER_ON) {
per_going_off = (per_next_state == PWRDM_POWER_OFF) ? 1 : 0;
omap2_gpio_prepare_for_idle(per_going_off);
omap2_gpio_prepare_for_idle(per_going_off, suspend);
}

/* CORE */
Expand Down Expand Up @@ -485,7 +485,7 @@ static void omap3_pm_idle(void)
trace_power_start(POWER_CSTATE, 1, smp_processor_id());
trace_cpu_idle(1, smp_processor_id());

omap_sram_idle();
omap_sram_idle(false);

trace_power_end(smp_processor_id());
trace_cpu_idle(PWR_EVENT_EXIT, smp_processor_id());
Expand Down Expand Up @@ -518,7 +518,7 @@ static int omap3_pm_suspend(void)

omap3_intc_suspend();

omap_sram_idle();
omap_sram_idle(true);

restore:
/* Restore next_pwrsts */
Expand Down
10 changes: 8 additions & 2 deletions drivers/gpio/gpio-omap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1554,12 +1554,15 @@ int omap2_gpio_prepare_for_idle(int off_mode, bool suspend)
struct gpio_bank *bank;

list_for_each_entry(bank, &omap_gpio_list, node) {
if (!bank->mod_usage)
continue;

omap2_gpio_set_wakeupenables(bank);

if (omap2_gpio_set_edge_wakeup(bank, suspend))
ret = -EBUSY;

if (bank->mod_usage && bank->loses_context && off_mode)
if (bank->loses_context && off_mode)
if (pm_runtime_put_sync_suspend(bank->dev) < 0)
dev_err(bank->dev, "%s: GPIO bank %d "
"pm_runtime_put_sync failed\n",
Expand All @@ -1577,7 +1580,10 @@ void omap2_gpio_resume_after_idle(int off_mode)
struct gpio_bank *bank;

list_for_each_entry(bank, &omap_gpio_list, node) {
if (bank->mod_usage && bank->loses_context && off_mode)
if (!bank->mod_usage)
continue;

if (bank->loses_context && off_mode)
if (pm_runtime_get_sync(bank->dev) < 0)
dev_err(bank->dev, "%s: GPIO bank %d "
"pm_runtime_get_sync failed\n",
Expand Down
4 changes: 2 additions & 2 deletions drivers/gpu/pvr/pvrversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

#define PVRVERSION_FAMILY "sgxddk"
#define PVRVERSION_BRANCHNAME "1.8"
#define PVRVERSION_BUILD 782847
#define PVRVERSION_BUILD 782952
#define PVRVERSION_BSCONTROL "CustomerGoogle_Android_ogles1_ogles2_GPL"

#define PVRVERSION_STRING "CustomerGoogle_Android_ogles1_ogles2_GPL sgxddk 18 1.8@" PVR_STR2(PVRVERSION_BUILD)
Expand All @@ -45,7 +45,7 @@
#define COPYRIGHT_TXT "Copyright (c) Imagination Technologies Ltd. All Rights Reserved."

#define PVRVERSION_BUILD_HI 78
#define PVRVERSION_BUILD_LO 2847
#define PVRVERSION_BUILD_LO 2952
#define PVRVERSION_STRING_NUMERIC PVR_STR2(PVRVERSION_MAJ) "." PVR_STR2(PVRVERSION_MIN) "." PVR_STR2(PVRVERSION_BUILD_HI) "." PVR_STR2(PVRVERSION_BUILD_LO)

#endif /* _PVRVERSION_H_ */
4 changes: 3 additions & 1 deletion drivers/gpu/pvr/sgx/sgxutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,9 @@ PVRSRV_ERROR SGXScheduleCCBCommand(PVRSRV_DEVICE_NODE *psDeviceNode,
goto Exit;
}

if ((eCmdType == SGXMKIF_CMD_TA) && bLastInScene)
if (eCmdType == SGXMKIF_CMD_2D ||
eCmdType == SGXMKIF_CMD_TRANSFER ||
((eCmdType == SGXMKIF_CMD_TA) && bLastInScene))
{
SYS_DATA *psSysData;

Expand Down
3 changes: 3 additions & 0 deletions drivers/usb/gadget/android.c
Original file line number Diff line number Diff line change
Expand Up @@ -839,6 +839,7 @@ static ssize_t enable_store(struct device *pdev, struct device_attribute *attr,

sscanf(buff, "%d", &enabled);
if (enabled && !dev->enabled) {
cdev->next_string_id = 0;
/* update values in composite driver's copy of device descriptor */
cdev->desc.idVendor = device_desc.idVendor;
cdev->desc.idProduct = device_desc.idProduct;
Expand All @@ -852,6 +853,8 @@ static ssize_t enable_store(struct device *pdev, struct device_attribute *attr,
dev->enabled = true;
} else if (!enabled && dev->enabled) {
usb_gadget_disconnect(cdev->gadget);
/* Cancel pending control requests */
usb_ep_dequeue(cdev->gadget->ep0, cdev->req);
usb_remove_config(cdev, &android_config_driver);
dev->enabled = false;
} else {
Expand Down
2 changes: 2 additions & 0 deletions sound/soc/omap/omap-mcpdm.c
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,9 @@ static int omap_mcpdm_dai_startup(struct snd_pcm_substream *substream,
val = __raw_readl(OMAP4430_CM1_ABE_PDM_CLKCTRL);
if ((val & CLKCTRL_MODULEMODE_MASK) != CLKCTRL_MODULEMODE_ENABLED) {
WARN(1, "Clock not enabled: PDM_CLKCTRL=0x%x\n", val);
mcpdm->active--;
pm_runtime_put_sync(mcpdm->dev);
err = -ENODEV;
goto out;
}

Expand Down
79 changes: 67 additions & 12 deletions sound/soc/soc-dsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@ static inline void be_reparent(struct snd_soc_pcm_runtime *fe,

list_for_each_entry(dsp_params, &be->dsp[stream].fe_clients, list_fe) {
if (dsp_params->fe != fe) {

dev_dbg(&fe->dev, " reparent %s path %s %s %s\n",
stream ? "capture" : "playback",
dsp_params->fe->dai_link->name,
stream ? "<-" : "->", dsp_params->be->dai_link->name);

fe_substream = snd_soc_dsp_get_substream(dsp_params->fe,
stream);
be_substream->runtime = fe_substream->runtime;
Expand All @@ -116,6 +122,10 @@ static inline void be_disconnect(struct snd_soc_pcm_runtime *fe, int stream)
list_for_each_entry_safe(dsp_params, d, &fe->dsp[stream].be_clients, list_be) {
struct snd_soc_pcm_runtime *be = dsp_params->be;

dev_dbg(&fe->dev, "BE %s disconnect check for %s\n",
stream ? "capture" : "playback",
be->dai_link->name);

if (dsp_params->state == SND_SOC_DSP_LINK_STATE_FREE) {
dev_dbg(&fe->dev, " freed DSP %s path %s %s %s\n",
stream ? "capture" : "playback",
Expand Down Expand Up @@ -396,9 +406,12 @@ static int soc_dsp_be_dai_startup(struct snd_soc_pcm_runtime *fe, int stream)

be_substream->runtime = be->dsp[stream].runtime;
err = soc_pcm_open(be_substream);
if (err < 0)
if (err < 0) {
dev_err(&be->dev, "BE open failed %d\n", err);
be->dsp[stream].users--;
be->dsp[stream].state = SND_SOC_DSP_STATE_CLOSE;
goto unwind;

}
be->dsp[stream].state = SND_SOC_DSP_STATE_OPEN;
count++;
}
Expand Down Expand Up @@ -1013,22 +1026,28 @@ static int dsp_run_update_startup(struct snd_soc_pcm_runtime *fe, int stream)
{
struct snd_soc_dsp_link *dsp_link = fe->dai_link->dsp_link;
struct snd_pcm_substream *substream = snd_soc_dsp_get_substream(fe, stream);
struct snd_soc_dsp_params *dsp_params;
int ret;

dev_dbg(&fe->dev, "runtime %s open on FE %s\n",
stream ? "capture" : "playback", fe->dai_link->name);

ret = soc_dsp_be_dai_startup(fe, stream);
if (ret < 0)
if (ret < 0) {
goto disconnect;
return ret;
}

ret = soc_dsp_be_dai_hw_params(fe, stream);
if (ret < 0)
if (ret < 0) {
goto close;
return ret;

}
ret = soc_dsp_be_dai_prepare(fe, stream);
if (ret < 0)
if (ret < 0) {
goto hw_free;
return ret;
}

/* run the stream event for each BE */
if (stream == SNDRV_PCM_STREAM_PLAYBACK)
Expand All @@ -1047,20 +1066,45 @@ static int dsp_run_update_startup(struct snd_soc_pcm_runtime *fe, int stream)

ret = soc_pcm_bespoke_trigger(substream, SNDRV_PCM_TRIGGER_START);
if (ret < 0) {
dev_err(&fe->dev,"dsp: trigger FE failed %d\n", ret);
return ret;
dev_err(&fe->dev,"dsp: bespoke trigger FE failed %d\n", ret);
goto stream_stop;
}
} else {
dev_dbg(&fe->dev, "dsp: trigger FE %s cmd start\n",
fe->dai_link->name);

ret = soc_dsp_be_dai_trigger(fe, stream,
SNDRV_PCM_TRIGGER_START);
if (ret < 0)
return ret;
if (ret < 0) {
dev_err(&fe->dev,"dsp: trigger FE failed %d\n", ret);
goto stream_stop;
}
}

return 0;

stream_stop:
if (stream == SNDRV_PCM_STREAM_PLAYBACK)
soc_dsp_dapm_stream_event(fe, stream,
fe->cpu_dai->driver->playback.stream_name,
SNDRV_PCM_TRIGGER_STOP);
else
soc_dsp_dapm_stream_event(fe, stream,
fe->cpu_dai->driver->capture.stream_name,
SNDRV_PCM_TRIGGER_STOP);
hw_free:
soc_dsp_be_dai_hw_free(fe, stream);
close:
soc_dsp_be_dai_shutdown(fe, stream);
disconnect:
/* disconnect any non started BEs */
list_for_each_entry(dsp_params, &fe->dsp[stream].be_clients, list_be) {
struct snd_soc_pcm_runtime *be = dsp_params->be;
if (be->dsp[stream].state != SND_SOC_DSP_STATE_START)
dsp_params->state = SND_SOC_DSP_LINK_STATE_FREE;
}
be_disconnect(fe, stream);
return ret;
}

static int dsp_run_update(struct snd_soc_pcm_runtime *fe, int stream,
Expand Down Expand Up @@ -1506,7 +1550,9 @@ int soc_dsp_fe_resume(struct snd_soc_pcm_runtime *fe)
int soc_dsp_fe_dai_open(struct snd_pcm_substream *fe_substream)
{
struct snd_soc_pcm_runtime *fe = fe_substream->private_data;
int err;
struct snd_soc_dsp_params *dsp_params;
int err, ret;
int stream = fe_substream->stream;

fe->dsp[fe_substream->stream].runtime = fe_substream->runtime;

Expand All @@ -1517,7 +1563,16 @@ int soc_dsp_fe_dai_open(struct snd_pcm_substream *fe_substream)
fe->dai_link->name, fe_substream->stream ? "capture" : "playback");
}

return soc_dsp_fe_dai_startup(fe_substream);
ret = soc_dsp_fe_dai_startup(fe_substream);
if (ret < 0) {
/* clean up all links */
list_for_each_entry(dsp_params, &fe->dsp[stream].be_clients, list_be)
dsp_params->state = SND_SOC_DSP_LINK_STATE_FREE;

be_disconnect(fe, stream);
fe->dsp[stream].runtime = NULL;
}
return ret;
}

/* called when closing FE stream */
Expand Down

0 comments on commit b1771ff

Please sign in to comment.