u16 right_step;
unsigned int step_delay;
u16 ramp;
+ struct delayed_work work;
struct completion ramp_done;
};
struct twl6040_output handsfree;
struct workqueue_struct *hf_workqueue;
struct workqueue_struct *hs_workqueue;
- struct delayed_work hs_delayed_work;
- struct delayed_work hf_delayed_work;
};
/*
static void twl6040_pga_hs_work(struct work_struct *work)
{
struct twl6040_data *priv =
- container_of(work, struct twl6040_data, hs_delayed_work.work);
+ container_of(work, struct twl6040_data, headset.work.work);
struct snd_soc_codec *codec = priv->codec;
struct twl6040_output *headset = &priv->headset;
unsigned int delay = headset->step_delay;
static void twl6040_pga_hf_work(struct work_struct *work)
{
struct twl6040_data *priv =
- container_of(work, struct twl6040_data, hf_delayed_work.work);
+ container_of(work, struct twl6040_data, handsfree.work.work);
struct snd_soc_codec *codec = priv->codec;
struct twl6040_output *handsfree = &priv->handsfree;
unsigned int delay = handsfree->step_delay;
case 2:
case 3:
out = &priv->headset;
- work = &priv->hs_delayed_work;
queue = priv->hs_workqueue;
out->left_step = priv->hs_left_step;
out->right_step = priv->hs_right_step;
break;
case 4:
out = &priv->handsfree;
- work = &priv->hf_delayed_work;
queue = priv->hf_workqueue;
out->left_step = priv->hf_left_step;
out->right_step = priv->hf_right_step;
return -1;
}
+ work = &out->work;
+
switch (event) {
case SND_SOC_DAPM_POST_PMU:
if (out->active)
goto hswq_err;
}
- INIT_DELAYED_WORK(&priv->hs_delayed_work, twl6040_pga_hs_work);
- INIT_DELAYED_WORK(&priv->hf_delayed_work, twl6040_pga_hf_work);
+ INIT_DELAYED_WORK(&priv->headset.work, twl6040_pga_hs_work);
+ INIT_DELAYED_WORK(&priv->handsfree.work, twl6040_pga_hf_work);
ret = request_threaded_irq(priv->plug_irq, NULL, twl6040_audio_handler,
0, "twl6040_irq_plug", codec);