mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Eugene Ilkov" <e.ilkov@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: akpm@osdl.org, perex@suse.cz
Subject: [PATCH] alsa soc wm8750 fix 2.6.20-rc1-mm1
Date: Wed, 20 Dec 2006 20:20:45 +0300	[thread overview]
Message-ID: <e13597370612200920k5d593863o6ba8580cf3e3c72e@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1866 bytes --]

 There was some INIT_WORK related changes, here is patch against
wm8750 codec driver. Tested on sharp sl-c1000


--- linux-2.6.20-rc1-mm1/sound/soc/codecs/wm8750.c	2006-12-20
19:23:27.000000000 +0300
+++ linux-2.6.20-rc1-mm.z1/sound/soc/codecs/wm8750.c	2006-12-20
19:27:28.000000000 +0300
@@ -52,7 +52,6 @@
 	printk(KERN_WARNING AUDIO_NAME ": " format "\n" , ## arg)
  static struct workqueue_struct *wm8750_workq = NULL;
-static struct work_struct wm8750_dapm_work;
  /*
  * wm8750 register cache
@@ -1001,9 +1000,11 @@
 };
 EXPORT_SYMBOL_GPL(wm8750_dai);
 -static void wm8750_work(void *data)
+static void wm8750_work(struct work_struct *work)
 {
-	struct snd_soc_codec *codec = (struct snd_soc_codec *)data;
+	struct snd_soc_device *socdev =
+		container_of(work, struct snd_soc_device, delayed_work.work);
+	struct snd_soc_codec *codec = socdev->codec;
 	wm8750_dapm_event(codec, codec->dapm_state);
 }
 @@ -1039,7 +1040,7 @@
 	if (codec->suspend_dapm_state == SNDRV_CTL_POWER_D0) {
 		wm8750_dapm_event(codec, SNDRV_CTL_POWER_D2);
 		codec->dapm_state = SNDRV_CTL_POWER_D0;
-		queue_delayed_work(wm8750_workq, &wm8750_dapm_work,
+		queue_delayed_work(wm8750_workq, &socdev->delayed_work,
 			 msecs_to_jiffies(1000));
 	}
 @@ -1084,7 +1085,7 @@
 	/* charge output caps */
 	wm8750_dapm_event(codec, SNDRV_CTL_POWER_D2);
 	codec->dapm_state = SNDRV_CTL_POWER_D3hot;
-	queue_delayed_work(wm8750_workq, &wm8750_dapm_work,
+	queue_delayed_work(wm8750_workq, &socdev->delayed_work,
 		msecs_to_jiffies(1000));
  	/* set the update bits */
@@ -1227,7 +1228,7 @@
 	INIT_LIST_HEAD(&codec->dapm_widgets);
 	INIT_LIST_HEAD(&codec->dapm_paths);
 	wm8750_socdev = socdev;
-	INIT_WORK(&wm8750_dapm_work, wm8750_work, codec);
+	INIT_DELAYED_WORK(&socdev->delayed_work, wm8750_work);
 	wm8750_workq = create_workqueue("wm8750");
 	if (wm8750_workq == NULL) {
 		kfree(codec);

[-- Attachment #2: wm8750-2.6.20-rc1-mm1.patch --]
[-- Type: message/rfc822, Size: 1674 bytes --]



+++ linux-2.6.20-rc1-mm.z1/sound/soc/codecs/wm8750.c	2006-12-20 19:27:28.000000000 +0300
@@ -52,7 +52,6 @@
 	printk(KERN_WARNING AUDIO_NAME ": " format "\n" , ## arg)
 
 static struct workqueue_struct *wm8750_workq = NULL;
-static struct work_struct wm8750_dapm_work;
 
 /*
  * wm8750 register cache
@@ -1001,9 +1000,11 @@
 };
 EXPORT_SYMBOL_GPL(wm8750_dai);
 
-static void wm8750_work(void *data)
+static void wm8750_work(struct work_struct *work)
 {
-	struct snd_soc_codec *codec = (struct snd_soc_codec *)data;
+	struct snd_soc_device *socdev = 
+		container_of(work, struct snd_soc_device, delayed_work.work);
+	struct snd_soc_codec *codec = socdev->codec;
 	wm8750_dapm_event(codec, codec->dapm_state);
 }
 
@@ -1039,7 +1040,7 @@
 	if (codec->suspend_dapm_state == SNDRV_CTL_POWER_D0) {
 		wm8750_dapm_event(codec, SNDRV_CTL_POWER_D2);
 		codec->dapm_state = SNDRV_CTL_POWER_D0;
-		queue_delayed_work(wm8750_workq, &wm8750_dapm_work,
+		queue_delayed_work(wm8750_workq, &socdev->delayed_work,
 			 msecs_to_jiffies(1000));
 	}
 
@@ -1084,7 +1085,7 @@
 	/* charge output caps */
 	wm8750_dapm_event(codec, SNDRV_CTL_POWER_D2);
 	codec->dapm_state = SNDRV_CTL_POWER_D3hot;
-	queue_delayed_work(wm8750_workq, &wm8750_dapm_work,
+	queue_delayed_work(wm8750_workq, &socdev->delayed_work,
 		msecs_to_jiffies(1000));
 
 	/* set the update bits */
@@ -1227,7 +1228,7 @@
 	INIT_LIST_HEAD(&codec->dapm_widgets);
 	INIT_LIST_HEAD(&codec->dapm_paths);
 	wm8750_socdev = socdev;
-	INIT_WORK(&wm8750_dapm_work, wm8750_work, codec);
+	INIT_DELAYED_WORK(&socdev->delayed_work, wm8750_work);
 	wm8750_workq = create_workqueue("wm8750");
 	if (wm8750_workq == NULL) {
 		kfree(codec);

             reply	other threads:[~2006-12-20 17:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-20 17:20 Eugene Ilkov [this message]
2006-12-21  5:47 ` Andrew Morton
2006-12-21 10:06   ` Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e13597370612200920k5d593863o6ba8580cf3e3c72e@mail.gmail.com \
    --to=e.ilkov@gmail.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®